Page 1 of 1

Get variable from URL problem

Posted: Mon Sep 15, 2008 11:27 am
by DNihilist
Hi guys. I'm new here. I checked around and can't find anyone else with this problem. So here goes.

I want to pull a variable from the URL and have that posted in a form.

ie http://mysite.com/incoming.php?link=http://google.com

I have tried it with the $_REQUEST function but all that does is put the variable in the text input. It does not post it and thus I have to hit the submit button myself.

Here is an example of the code I am working with.

Code: Select all

<form name="form1" method="post" action="http://mysitecom/result.php">
<input name="link" type="text" size="50" value="<?php echo $_REQUEST['link']; ?>">
<input type="submit" name="send" value="Submit">                
<input type="hidden" name="submitted" value="TRUE">
</form>

Re: Get variable from URL problem

Posted: Mon Sep 15, 2008 12:07 pm
by ahowell
PHP won't automatically post a form for you. You'll need to use javascript.

Re: Get variable from URL problem

Posted: Mon Sep 15, 2008 12:08 pm
by DNihilist
would you mind helping me further with that?

Re: Get variable from URL problem

Posted: Mon Sep 15, 2008 12:21 pm
by DNihilist