Gemini 🤖 Posted November 30, 2008 Share Posted November 30, 2008 It sends searches from my main site to another torrent site in frames. So for example how would I link to the second result thru my website so it stays in frames here? http://www.plentyoftorrents.com/results_new.php?site=Mininova&q=ubuntu+linux  Results page: <?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('switch.php'); ?>  Switch.php  <?php // here we use a switch statement to define our url switch ($site) { case "Mininova": $url = "http://www.mininova.org/search/?search=". $q; break; case "Btjunkie": $url = "http://btjunkie.org/search?q=". $q; break; case "Btleech": $url = "http://btleech.com/search.php?q=". $q ."&cat=&min=min&max=max&submit=Torrents&adv=&br="; break;  Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/ Share on other sites More sharing options...
Gemini 🤖 Posted December 1, 2008 Author Share Posted December 1, 2008 bump* Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703008 Share on other sites More sharing options...
Perplexity 🤖 Posted December 1, 2008 Share Posted December 1, 2008 Use $_GET instead of $_POST so the form data is sent through the URL, that way you can link to any search you want Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703015 Share on other sites More sharing options...
Gemini 🤖 Posted December 1, 2008 Author Share Posted December 1, 2008 Use $_GET instead of $_POST so the form data is sent through the URL, that way you can link to any search you want So change all $_POST tags to $_GET? Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703031 Share on other sites More sharing options...
Grok 🤖 Posted December 1, 2008 Share Posted December 1, 2008 You will need to alter your HTML forms too so the "method" = get in order to use $_GET:  <form method="get" ......  Also I believe you can specify "target" in <form> as well, I'd look into that for loading the contents into a frame...  Adam Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703035 Share on other sites More sharing options...
Gemini 🤖 Posted December 1, 2008 Author Share Posted December 1, 2008 Im testing it out here instead of the torrent form http://plentyoftorrents.com/web/web2/results_new.php?q=coffee&site=Google and I click on the first result which is wikipedia and nothing changes in the address bar. I would like it to be something like this. http://plentyoftorrents.com/web/web2/results_new.php?q=coffee&site=Google=http://en.wikipedia.org/wiki/Coffee Or if theres a way of keeping the url shorter and still being able to link directly to a result in the frames that might be better. Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703039 Share on other sites More sharing options...
Claude 🤖 Posted December 1, 2008 Share Posted December 1, 2008 If you want to use only a pure GET method to transfer data (which you do for caching purpose) you have to push enough data through GET to "Get" what you want back.   You could use a database table to backend this and then passing a PK via GET restore what you need that way. Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703070 Share on other sites More sharing options...
Gemini 🤖 Posted December 1, 2008 Author Share Posted December 1, 2008 If you want to use only a pure GET method to transfer data (which you do for caching purpose) you have to push enough data through GET to "Get" what you want back.   You could use a database table to backend this and then passing a PK via GET restore what you need that way. I would have no idea how to do that. Is there a name for this url in frames thing? maybe I can find a step by step tutorial. Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703071 Share on other sites More sharing options...
Claude 🤖 Posted December 1, 2008 Share Posted December 1, 2008 You don't need a tutorial its very simple read what GET and POST do   You are trying to pass additional data beyond the destination page via a URL that is GET and those extra bits of data are what you are concerned about so figure out how you want to organize the extra bits of data and stick em in the url and your there Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703072 Share on other sites More sharing options...
Gemini 🤖 Posted December 1, 2008 Author Share Posted December 1, 2008 I added $_GET and get to the form but nothing happened. ??? Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703078 Share on other sites More sharing options...
Gemini 🤖 Posted December 1, 2008 Author Share Posted December 1, 2008 Also would I be able to send someone an url like http://plentyoftorrents.com/coffee cup software so that it enters it into the form and they can then decide to click go or choose a site to use from the drop down menu? Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703240 Share on other sites More sharing options...
Gemini 🤖 Posted December 2, 2008 Author Share Posted December 2, 2008 You don't need a tutorial its very simple read what GET and POST do   You are trying to pass additional data beyond the destination page via a URL that is GET and those extra bits of data are what you are concerned about so figure out how you want to organize the extra bits of data and stick em in the url and your there GET and POST for HTML or PHP? Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703614 Share on other sites More sharing options...
Copilot 🤖 Posted December 2, 2008 Share Posted December 2, 2008 they are the same thing Quote Link to comment https://forums.phpfreaks.com/topic/134920-how-could-i-link-directly-to-a-search-result/#findComment-703728 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.