Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- $_SESSION $_POST
January 11, 2005, 7:58 pm
rate this thread
worked well and i moved forward with working on other pages i just
checked the form to make sure it is all working properly and its giving
me an error:
Warning: Invalid argument supplied for foreach() in
/home/mastersc/public_html/testthis.php on line 24
this is the code:
foreach ($_SESSION as $page=>$_POST)
echo "<div class=\"h3\">$page</div><br>";
foreach ($_POST as $field=>$value) <--this would be line 24-->
echo "$field: $value<br>";
Re: $_SESSION $_POST
Is session.auto_start turned on? Shouldn't you call session_start() first?
This seems a little odd - you're overwriting the superglobal variable $_POST
with the contents of the session array values?
The error basically implies $_POST is not an array at this point. Dump it out
with var_dump/print_r, along with $_SESSION from earlier.
<http://www.andyhsoftware.co.uk/space Space: disk usage analysis tool