session problem
Posted: Wed Mar 19, 2008 6:26 pm
hi , i am trying to pass an array in a session, but i am not having much luck. the array will print_r() fine, so i know it is being built. But the issue is on the next page, i expect to see the same results....i only get Array()- any thoughts???
Code: Select all
//page 1
session_start();
$_SESSION['error']=array();
$error=$_SESSION['error'];
$numerics=array($rf['zip'],$rf['contact_num'],$rf['dvd_qty'],$rf['vhs_qty']);
for($b=0;$b<count($numerics);$b++)
{
$isnum=isNumeric($numerics[$b]);
if(! $isnum)
{
$keyname=array_keys($rf,$numerics[$b]);
array_push($error,$keyname);
}
}
$url=hostURL();
$extra = 'order_form.php';
header("Location: http://$url$extra");
Code: Select all
//page 2
<?php
session_start();
print_r($_SESSION['error']);
unset($_SESSION['error']);
?>