Help - Search - Members - Calendar
Full Version: Answered
Sal's RuneScape Forum > Everything... Not RuneScape > Tech Talk > Programming & Web Development
Yippee
OK, I have a search thing set up with FreeFind. I want to embed the results into my website. The textbox and form tags are set up, and it forwards to the page "search.html". More specifically, it forwards to the page http://www.mechhelp.net/search.html?s=MYSEARCHTERM where MYSEARCHTERM is whatever was typed into the text box. I've figured this all out already. All I need is to know how to detect the ?s=MYSEARCHTERM in the URL and get it into a variable in the code. I know enough coding to use that variable to display the search results, I've just never worked with forms before.

Can PHP do this? That's what I would prefer using, but I'm capable of learning enough of whatever language I need to be able to use it.
Samarkov
QUOTE (Yippee @ Jul 24 2009, 02:34 PM) *
OK, I have a search thing set up with FreeFind. I want to embed the results into my website. The textbox and form tags are set up, and it forwards to the page "search.html". More specifically, it forwards to the page http://www.mechhelp.net/search.html?s=MYSEARCHTERM where MYSEARCHTERM is whatever was typed into the text box. I've figured this all out already. All I need is to know how to detect the ?s=MYSEARCHTERM in the URL and get it into a variable in the code. I know enough coding to use that variable to display the search results, I've just never worked with forms before.

Can PHP do this? That's what I would prefer using, but I'm capable of learning enough of whatever language I need to be able to use it.

PHP can sure do this.

CODE
<?php
$variable = $_GET['s'];
?>
Yippee
Thanks. Sorry it took me two days, but I don't get on the computer on Sundays.

OK, so question two. Right now I'm using an <iframe> tag to embed the search results page, but when clicking on a link in the results, it opens in that iframe. Example: http://mechhelp.net/phptests/search.php?s=mech Is there a different tag to do this so the links open how they're supposed to? Or do I have to use some JavaScript or PHP thing to load the HTML and put it into a <div> tag?

EDIT: Nevermind. I'm not sure exactly how it worked, but changing one of the variables in the iframe's URL changed the links to open in the main frame. Something like that... It works, anyway.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.