Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This is probably very simple, but I can't seem to figure it out.

If we have straight html and a form with method="GET",  
action="http:/www.foo.com", and hidden variables of var1 and var2 with  
values, the submit button results in a URL of


What I want to do is have this be a php page and have a conditional  
statement in there that sets the value of var2.  That is also no problem,  
except I want this condition to be based upon whether text field txt1 is  
empty or has information put in there by the user.  I cannot figure out how  
to reference the text fiels txt1 in order to formulate the test.

I have tried   $txt1, $_POST['txt1'] and $_GET['txt1'].  What I want to  
generate is a URL of either


depending upon whether or not txt1 is empty and I want to do this within the  
<body></body> section.




Shelly wrote:
Quoted text here. Click to load it

When you want to react on what the user has entered in the text1 input field  
(I assume this is an input field) before the info is submitted to the  
server, PHP can't help you and you will have to resort to some client-side  
technique, like JavaScript.


Site Timeline