<?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 connects to a MySQL database and fetches data from a table. |
how to get current lat and lng from ip address using google map api in php? |
How to check whether a given year is a leap year using php. |
How to check if a given number is a perfect number. |
how can i solve php header errors? |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
Create a PHP script that checks whether a given number is a prime number or not. |
Create a PHP function to count the number of vowels in a string. |
