<?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
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP function to check if a given string is a palindrome |
How to prevent SQL Injection using php |
Write a PHP script that calculates the factorial of a given number. |
How to call travelport catalogproductofferings api using php? |
Create a PHP script that processes a form submission and displays the submitted data. |
Write a PHP script that generates a random password of a specified length. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |