<?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 get country, state and city select option using google map api in php |
how to get response status in api using curl php? |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
How to convert a temperature from Celsius to Fahrenheit using php. |
How to prevent SQL Injection using php |
Create a PHP script that checks whether a given number is a prime number or not. |
Create a PHP script that prints the current date and time. |