<?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 current lat and lng from ip address using google map api in php? |
Create a PHP script that prints the current date and time. |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
How to get the largest element in an array of numbers |
Create a PHP function to count the number of vowels in a string. |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
Write a PHP script that calculates the sum of digits in a given number. |
How to show location using google map in JavaScript? |
