Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden array entries...

Status
Not open for further replies.

youradds

Programmer
Joined
Jun 27, 2001
Messages
817
Location
GB
I'm working on a script that will grab hidden variables from an HTML page. The HTML page has stuff like;

<hidden name=&quot;title[0]&quot; value=&quot;Testing1&quot;>
<hidden name=&quot;title[1]&quot; value=&quot;Testing2&quot;>
<hidden name=&quot;title[2]&quot; value=&quot;Testing3&quot;>
<hidden name=&quot;title[3]&quot; value=&quot;Testing4&quot;>

I have an example script;

<?php

global $title;

foreach ($title as $_title) { echo &quot;$_title<BR>&quot;; }

?>

However, this gives me an error;


Warning: Invalid argument supplied for foreach() in /home/askweddi/public_html/a/test.php on line 5

Anyone got any ideas as to why I'm getting this problem?

Sorry to keep asking so many questions...but I'm pretty new to this array/foreach stuff in PHP, as I only started playig with it all recently :p

Cheers

Andy
 
try $_POST[title] or $_GET[title], depending on what method your form uses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top