Jump to content

how can I make a select feild change the site on this code?


cosmoshell

Recommended Posts

<body><center>
<form method="get" action="/search/websearch.php" target="_top">
<table border="0" bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32"></td>
<td nowrap="nowrap">
<label for="sbi" style="display: none">Enter your search terms</label>
<input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input>
<label for="sbb" style="display: none">Submit search form</label>
<select name=mytextarea>
<option name=web value=web> web </option>
<option name=images value=images> Images </option>
</select>
<input type="submit" name="sa" value="Search" id="sbb"></input>
</td></tr>
<tr>
<td> </td>
<td nowrap="nowrap">
<table>
<tr>
<td>
<td>
</tr>
</table>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="UTF-8"></input>
<input type="hidden" name="oe" value="UTF-8"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</center><form name=myform>

 

lets say i want web /search/websearch.php

and images /search/imagesearch.php

 

how can i do this?

Hi cosmoshell,

 

In websearch.php, get all of the POSTed data and then with the POSTed "web" and "images" variables perform an if statement like:

 

$web = addslashes($_POST['web']);
$images = addslashes($_POST['images']);

if($web == "on")
{
do a web search (insert your web search code here)
}
else
{
do an image search (insert your image serach code here)
}

 

The above is very basic code which should give you an idea of how to achieve your required searches.

Hi cosmoshell,

 

In websearch.php, get all of the POSTed data and then with the POSTed "web" and "images" variables perform an if statement like:

 

$web = addslashes($_POST['web']);
$images = addslashes($_POST['images']);

if($web == "on")
{
do a web search (insert your web search code here)
}
else
{
do an image search (insert your image serach code here)
}

 

The above is very basic code which should give you an idea of how to achieve your required searches.

 

Is there a way to resend the information for example google? from (insert your image serach code here). I know what $_post does now that i read up on it, i just cant figure out how to send from within (). I someone understand varibles now to, so im getting somewhere lol.

 

Im trying to get this so after a search you are brought to and external search result, with at the top of the page there will be a special bar.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.