Lab #4
5. Write two different PHP scripts to demonstrate passing variables with sessions
first.php
<?php
if(session_start()){
echo "Session start";
}
$_SESSION['name'] = "Bruce banner";
$_SESSION['hero_name'] = "Hulk";
?>
<?php
session_start();
echo "Session access <br/> <br/>";
if(isset($_SESSION['name']) && isset($_SESSION['hero_name'])){
echo "Name: ".$_SESSION['name']."<br/>";
echo "Hero Name: ".$_SESSION['hero_name']."<br/>";
}
?>
first page
Happy Coding :)
0 Comments
Post a Comment