Answers for "_SESSION[] 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
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

Browse Popular Code Answers by Language