<?php
session_start();
// Set session variables
$_SESSION['username'] = 'john_doe';
$_SESSION['user_id'] = 123;
// Display session data
echo "Username: {$_SESSION['username']}, User ID: {$_SESSION['user_id']}";
?>
<?php
session_start();
// Set session variables
$_SESSION['username'] = 'john_doe';
$_SESSION['user_id'] = 123;
// Display session data
echo "Username: {$_SESSION['username']}, User ID: {$_SESSION['user_id']}";
?>
Related
Write a PHP script that calculates the sum of digits in a given number. |
Create a PHP script that uses sessions to store and display user information. |
how to get country, state and city select option using google map api in php |
how to get response status in api using curl php? |
How to prevent SQL Injection using php |
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP script that checks if a given string is a valid email address. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |