<?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 function to check if a given string is a palindrome |
Create a PHP script that prints the current date and time. |
how to get current latitude and longitude using google map api in php? |
How to check whether a given year is a leap year using php. |
how to get response status in api using curl php? |
what is PhpUnit? |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP script that calculates the average of an array of numbers. |