<?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 function to count the number of vowels in a string. |
Write a PHP script that checks if a given string is a valid email address. |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
how to get current latitude and longitude using google map api in php? |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
how to get current lat and lng from ip address using google map api in php? |
How to call travelport catalogproductofferings api using php? |
Write a PHP script that calculates the sum of digits in a given number. |
