<?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
How to check if a given number is a perfect number. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
how to get country, state and city select option using google map api in php |
How to check whether a given year is a leap year using php. |
Create a PHP script that calculates the average of an array of numbers. |
How to show location using google map in JavaScript? |
How to prevent SQL Injection using php |