Hi all. Im trying to get my search form to output the persons query into the browsers address bar. Does anyone know how to do this?
I added the relating files code below. first is the html form, then the results_new.php page which is where the resulting site is displayed in a frame. Then the site switch page which does something else with the querys.
[CODE]
<form name=”search” action=”results_new.php” method=”post”>
<input type=”text” name=”q” onclick=”this.value=”” value=”Torrent Search”>
<select name=”site”width=”140″ style=”width: 140px”>
<option>Sumotorrents</option>
<option>Nutorrent</option>
</select>
<input type=”submit” value=” Search ” style=”background-color: #e3eeff; border: 1px solid #000; cursor: pointer;”>
</form>
heres the results new page where the search form sends the query.
[code=php]<?php
// grab the search query and request site from the url
if($_POST[“q”]){
$q = $_POST[“q”];
}else{
$q = $_GET[‘q’];
}
$q = htmlentities(stripslashes(trim($q)));
if($_POST[‘site’]){
$site = $_POST[“site”];
}else{
$site = $_GET[‘site’];
}
include(‘site_switch.php’);
// finally create the code for the actual frames. This is simple HTML with the search query and site put into the menubar’s url so we can change it later if wanted.
?>
Now heres the site switch
[code=php]case “Torrentz”:
$url = “http://www.torrentz.com/search?q=”. $q. “&x=0&y=0”;
break;
case “Nutorrent”;
$url = “http://www.nutorrent.com/search.php?q=”.$q.”&cid=0&search.x=0&search.y=0″;
break;