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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing data in forms

Status
Not open for further replies.

Julzzey

Programmer
Sep 2, 2002
19
US
Hi,

I know this is easy, but I can't get my code to accept hidden variables. I have the following form that I thought would pass the value of name to the form.

<form method=POST action=&quot;<?php echo $_SERVER['PHP_SELF']?>?action=insert&quot;>
<input type=&quot;hidden&quot; name=&quot;name&quot; value=&quot;$name&quot;>
<input type=&quot;hidden&quot; name=&quot;address&quot; value=&quot;$address&quot;>
<input type=&quot;submit&quot;>
</form>

I output $name to the screen before I submit and it's correct, but when I get to the next form (which is in the same script) it can't find that value. Is there a certain way to retrieve hidden data?

Thanks!!
 
I don't know if this is right, but have a look at what $_REQUEST does, it might work for you.

Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
Thanks...you know I tried $_REQUEST and many other things...sometimes I think code is possessed!!! I got it to work though. I put it inside of the php and used an echo and off it went just fine.

Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top