<?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
what is PhpUnit? |
Write a PHP script that generates a random password of a specified length. |
How to show location using google map in JavaScript? |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
Create a PHP script that processes a form submission and displays the submitted data. |
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. |
Create a PHP script that uses sessions to store and display user information. |