I just cant figure it out with what I know so far. See how you can select the little scissors and 'cut' out the listing and store it for print later. How could this be done with php?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Parameter Passing Test </title>
</head>
<body>
<?
// set up session var array if not existing
if (!isset($_SESSION['list'])){
$_SESSION['list']=array("item1","item2","item3","item4",); // fill the array with some test data to find where its going wrong
}
// append the value of the passed parameter into the array
$_SESSION['list'][]=$_GET['parameter'];
//Output the list
echo("<h2>Here is your list</h2><br>");
// access the array in the session Var and output the values stored in it
foreach($_SESSION['list'] as $key => $value){
echo($key." = ".$value."<br>\n");
}
?>
<hr>
<h2>Pick an item from here</h2><br>
<p>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Fishpaste">Fishpaste</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Handgrenade">Hangrenade</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Mobile Phone">Mobile Phone</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Shoelaces">Shoelace</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Rubber Duck">Rubber Duck</a><br>
</p>
</body>
</html>
<? session_start(); ?>
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Parameter Passing Test </title>
</head>
<body>
<?
// set up session var array if not existing
if (!isset($_SESSION['list'])){
$_SESSION['list']=array("item1","item2","item3","item4",); // fill the array with some test data to find where its going wrong
}
// append the value of the passed parameter into the array
$_SESSION['list'][]=$_GET['parameter'];
//Output the list
echo("<h2>Here is your list</h2><br>");
// access the array in the session Var and output the values stored in it
foreach($_SESSION['list'] as $key => $value){
echo($key." = ".$value."<br>\n");
}
?>
<hr>
<h2>Pick an item from here</h2><br>
<p>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Fishpaste">Fishpaste</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Handgrenade">Hangrenade</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Mobile Phone">Mobile Phone</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Shoelaces">Shoelace</a><br>
<a href="<?=$_SERVER['PHP_SELF'];?>?parameter=Rubber Duck">Rubber Duck</a><br>
</p>
</body>
</html>