<?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 can i solve php header errors? |
Write a PHP script that calculates the sum of digits in a given number. |
How to call travelport catalogproductofferings api using php? |
How to prevent SQL Injection using php |
how to get current latitude and longitude using google map api in php? |
Write a PHP script that generates a random password of a specified length. |
how to get country, state and city select option using google map api in php |
Create a PHP script that processes a form submission and displays the submitted data. |