Forum Moderators: coopster
I've been working on this for ages and can't figure it out, my PHP isnt all that good so hopefuly someone here will find a few minutes to help me out.
OK, i want a customer to be able to enter a term in the URL - www.mywebsite.com/script.php?Term=WHATEVER
What i need to do is to have a script that will grab the term from the URL and then enter it in a form on a remote site which uses the POST method.
The Form name is 'MainSearch'
Action is 'search.asp'
Element Name is 'Search'
Value will be 'TERM'
The results can then be displayed in the remote website in the same window.
I've been told its easy but i've been at it for a very long time with not much luck.
Thank In Advance.
You can retrieve the term from the url query by using the $_GET [us3.php.net] superglobal. With this, you can then submit a form from your own site to the remote site. Something like this maybe?:
<form method="post" action="http://remote-host.com/search.asp">
Search<input type="text" name="Search" value="<?php echo $_GET['Term'];?>" size="40" /><br />
<input type="submit" value="Search!" /></form>
Good luck! I hope this helps.
Anyway, i changed it slightly so all fields are hidden and instead of having submit button i've used:
<body onLoad="document.MYFORMNAME.submit()"> So page automatically sends info to other website.
But mission complete. Thanks so much!