<?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 script that processes a form submission and displays the submitted data. |
Write a PHP function to check if a given string is a palindrome |
How to show location using google map in JavaScript? |
how to get current lat and lng from ip address using google map api in php? |
how to get response status in api using curl php? |
Write a PHP script that calculates the factorial of a given number. |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
Write a PHP script that calculates the sum of digits in a given number. |