Andy or Somebody,
Dummy newbie Ray asking basic questions again...
If I have a file named file.php?id=ray...How do I pass the value "Ray" to an order form text box called "name"?
I want to pass the name into the field so "Ray" doesn't have to fill in the text box.
Remember, I am a dummy and need detailed examples (with lots of comments).
Thanks in advance for your always great accurate information!
Ray
eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%72%61%79%63%72%61%6d%62%6c%69%74%40%63%6f%6c%75%6d%62%75%73%2e%72%72%2e%63%6f%6d%22%3e%72%61%79%63%72%61%6d%62%6c%69%74%40%63%6f%6c%75%6d%62%75%73%2e%72%72%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))
How to pass a variable to a form text box??
in file.php, just put:
">And that should allow for their name to be in the text box when they go to the page.
-Andrew Riley
Follow up question RE: previous
Andy,
Okay Mr. Genious (I really appreciate your prompt "accurate" replies)...as usual your suggestion worked like a charm!
I'll bother you with another question...
How do I pass data from form fields (like a text box for example) on one form and have the results of the original form show up in a text boxt on another form?
Example:
Original form has name field, address field, email field. When fields are filled in they click the submit button it goes to the second form and carries the name, address, email from the first forms text boxes to the new forms text boxes with the same names.
Also, do I make the original forms "form method" Post and the action=the second forms name?
Someday I will learn these basic steps and not have to depend on the goodwill of masters like you.
Thanks in advance for the detailed (I'm a dummy remember) explanations for me.
Ray
How to pass a variable to a form text box??
I think that the solution to the first question will fail if register_globals is set off. Am I correct?
How to pass a variable to a form text box??
donpro wrote:I think that the solution to the first question will fail if register_globals is set off. Am I correct?
Correct, in that case you should use:
">which would actually work even with register_globals on. I try to use the new autoglobals ($GLOBALS, $_GET, $_POST, $_SERVER, $_SESSION, $_COOKIE, $_FILES, $_ENV, $_REQUEST) all the time now since they are the currently accepted way to do everything.
From php.net:
Quote:Caution:
If you want your script to work regardless of register_globals, you need to use the $_SESSION array. All $_SESSION entries are automatically registered. If your script uses session_register(), it will not work in environments where register_globals is disabled.
I'm assuming (and hoping) that register_globals will eventually be completely phased out (along with all the unnecesary session functions).
Blah! that was longer than I meant it to be! ;)