<?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
Write a PHP function that throws a custom exception if a condition is not met. |
how to get current lat and lng from ip address using google map api in php? |
Write a PHP function to check if a given string is a palindrome |
what is PhpUnit? |
Create a PHP script that uses sessions to store and display user information. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
How to show location using google map in JavaScript? |
Create a PHP script that processes a form submission and displays the submitted data. |
