<?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 sets a cookie with user preferences and retrieves it on subsequent visits. |
Write a PHP script that parses JSON data and displays specific information. |
How to check if a given number is a perfect number. |
how to get current latitude and longitude using google map api in php? |
how to get response status in api using curl php? |
How to get the largest element in an array of numbers |
Create a simple PHP script that calculates the sum of all even numbers between 1 and 10. |