<?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 counts the number of occurrences of each word in a given sentence. |
Write a PHP script that checks if a given string is a valid email address. |
Write a PHP script that generates a random password of a specified length. |
Write a PHP script that parses JSON data and displays specific information. |
How to call travelport catalogproductofferings api using php? |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
Write a PHP script that calculates the sum of digits in a given number. |
Write a PHP function that throws a custom exception if a condition is not met. |
