<?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 sum of digits in a given number. |
how to get current lat and lng from ip address using google map api in php? |
how to get country, state and city select option using google map api in php |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
how to get current latitude and longitude using google map api in php? |
Create a simple PHP script that calculates the sum of all even numbers between 1 and 10. |
How to get the largest element in an array of numbers |
Write a PHP script that generates a random password of a specified length. |