Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Engine DDL

Status
Not open for further replies.

cian

Technical User
Oct 11, 2001
1,383
Hi guys,
having difficulties,

I have a dropdownlist of search engines which allows the users to pick a search engine which will redirect them to the search results page of that particular engine.
The form submits to a page which has code like the following:

<?php
$engine = $HTTP_POST_VARS[&quot;engine&quot;];
$search = $HTTP_POST_VARS[&quot;search&quot;];
$searchterms = urlencode($search);

if ($engine==&quot;google&quot;) {
header('Location: }

the problems is the script is sending $searchterms to google rather than the value of searchterms.
Can you see where I have gone wrong?






<!--#sig value=''É'' url='' -->
 
It's ok, I figured it out.

Solution: double quotes instead of single

header(&quot;Location: &quot;);

amazing how something so small can wreck your head for hours!!

Also: TT seems to have a TGML problem re:square brackets, some code requires square brackets.





<!--#sig value=''É'' url='' -->
 
Hi cain,

Had the square bracket problem myself. Use [ignore]
Code:
[/ignore] instead of [ignore][tt][/ignore] -seems to be working fine!


Jakob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top