<?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. |
How to get the largest element in an array of numbers |
Write a PHP script that generates a random password of a specified length. |
Write a PHP function that throws a custom exception if a condition is not met. |
How to call travelport catalogproductofferings api using php? |
Create a PHP script that checks whether a given number is a prime number or not. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
How to check if a given number is a perfect number. |
