<?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 calculates the sum of digits in a given number. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
how to get current lat and lng from ip address using google map api in php? |
Write a PHP script that generates a random password of a specified length. |
How to reverses a given string using PHP. |
Write a PHP script that checks if a given string is a valid email address. |
How to show location using google map in JavaScript? |
