note 30027 deleted from function.session-register by sniper

From: Date: Wed, 14 May 2003 14:42:27 +0000
Subject: note 30027 deleted from function.session-register by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-47961@lists.php.net to get a copy of this message
If you want to use sessions in php 4.30 and globals OFF And you want to create a dynamic array. <?php session_start(); ?> <html> <head> <title>Untitled</title> </head> <body> <?php if (isset($_GET['table'])){ if (isset($_SESSION['job_info'])){// check if it exsist one session named "job_info" $job_info =$_GET['table']; array_push ($_SESSION['job_info'],$job_info);//add new data to the array } else{ $job_info[] =$_GET['table']; $_SESSION['job_info']=$job_info;//create new array } $i = count ($_SESSION['job_info']); $i--; for(;$i>=0;$i--){ echo $_SESSION['job_info'][$i];//prints all aray data } } ?> <br><a href="session_global_off.php?table=data">new array data</a> </body> </html>

« previous php.notes (#47961) next »