<?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 convert a temperature from Celsius to Fahrenheit using php. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
Create a PHP script that prints the current date and time. |
How to show location using google map in JavaScript? |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
how can i solve php header errors? |
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. |
