/    Sign up×
Community /Pin to ProfileBookmark

search not outputting to adress bar

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=”&nbsp;&nbsp;&nbsp;Search&nbsp;&nbsp;&nbsp;” style=”background-color: #e3eeff; border: 1px solid #000; cursor: pointer;”>
</form>[/CODE]

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.

?>[/code]

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;[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@torrentsauthorMay 11.2008 — fixed it. I changed post to get. now it works.
×

Success!

Help @torrents spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...