Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- php variable retrieval
March 9, 2005, 1:35 am
rate this thread
I need some help regarding variable passing in php. I have a script which
writes the current form text box values to an email script which works
correctly. Should I use a variable which was created on the page within a
As an example,
$sf_Bizname = $HTTP_POST_VARS['BizName'] works when BizName is the "name"
of the textbox. It doesn't when it is declared as var BizName = "MyBiz".
- Senator Jay Billington Bulwort
March 9, 2005, 4:51 pm
Re: php variable retrieval
that's taking place on the client-side unless you force it to. The best
var BizName = "MyBiz";
item.value = BizName;
<form method="post" action="test.php">
Upon submitting this form, if the user had clicked inside the text box,
test.php would receive $_REQUEST[biznamefield] with a value of "MyBiz."
values, of course; you could stick an onLoad() in the body tag to call a
function that would populate as many fields as you like.
While I haven't tried, I don't believe this will work on hidden fields.
Bulworth : PHP/MySQL/Unix | Email : str_rot13('firstname.lastname@example.org');
<http://www.phplabs.com/ | PHP scripts, webmaster resources