<?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 factorial of a given number using an iterative approach. |
Write a PHP script that calculates the factorial of a given number. |
How to get the largest element in an array of numbers |
how to get current lat and lng from ip address using google map api in php? |
Create a simple PHP script that calculates the sum of all even numbers between 1 and 10. |
Write a PHP script that checks if a given string is a valid email address. |
Create a PHP script that prints the current date and time. |
How to call travelport catalogproductofferings api using php? |