Answers for "how to store session value in variable in php"

PHP
7

set php varibianle session

<?php 
  // Start the session
  session_start();
?>
<!DOCTYPE html>
<html>
  <body>
  <?php
    // Set session variables
    $_SESSION["color"]= "blue";
    $_SESSION["animal"]= "dog";
    echo "The session variable are set up.";
  ?>
  </body>
</html>
Posted by: Guest on March-30-2020
1

php session destroy

<?php
// Destroy the currently active session.
session_destroy();
?>
Posted by: Guest on April-14-2020
4

php session variables

<?php
   session_start();
   $_SESSION['var'];
?>
Posted by: Guest on March-18-2020
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

can we acces session variable in two files

<?php
  session_start();

  ...

  if($responseCode == 1) {
    $_SESSION['card_id']    = $_POST['card_id'];
    $_SESSION['password']   = $_POST['password'];
    print '<script type="text/javascript">'; 
    print 'window.location = "http://domain.com/File2.php";';
    print '</script>';
  }
?>
Posted by: Guest on August-13-2020

Code answers related to "how to store session value in variable in php"

Browse Popular Code Answers by Language