Answers for "how to display session variables values in profile in php"

PHP
0

print all session variables php

echo print_r($_SESSION, TRUE);
Posted by: Guest on November-06-2021
0

getting input value in session variable in php

$qty = isset($_GET['qty']) ? $_GET['qty'] : 1;
$_SESSION['qty'] = $qty;
Posted by: Guest on July-20-2020
0

session variable

session_start();
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = new mysqli('localhost', 'username', 'password', 'db_name');
$link->set_charset('utf8mb4'); // always set the charset
$name = $_GET["username"];
$stmt = $link->prepare("SELECT id FROM Users WHERE username=? limit 1");
$stmt->bind_param('s', $name);
$stmt->execute();
$result = $stmt->get_result();
$value = $result->fetch_object();
$_SESSION['myid'] = $value->id;
Posted by: Guest on January-16-2022

Code answers related to "how to display session variables values in profile in php"

Browse Popular Code Answers by Language