houssam_ballout Posted July 10, 2007 Share Posted July 10, 2007 hello all,I'd developed a simple search engine that searches through records in database, I'd located the button and the text box in the index page, when the user enter the keywords, I want to display the results in a pop-up window?the results works fine when the user enters anything in the search engine and clicks search Link to comment Share on other sites More sharing options...
justsomeguy Posted July 10, 2007 Share Posted July 10, 2007 If the page is not XHTML, you can set a target on the form to open a new window when the form gets submitted. If you are using XHTML, I'm not sure you can do that.<form target="_blank" ...> Link to comment Share on other sites More sharing options...
houssam_ballout Posted July 10, 2007 Author Share Posted July 10, 2007 If the page is not XHTML, you can set a target on the form to open a new window when the form gets submitted. If you are using XHTML, I'm not sure you can do that.<form target="_blank" ...>ok, how can I pass form variable to the next page?like I'd a text box named: searchWord, how I can pass it to the next page so that I can use with the sql to select data based on the search keyword? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 10, 2007 Share Posted July 10, 2007 The form will automatically pass any input values to the next page. Link to comment Share on other sites More sharing options...
houssam_ballout Posted July 11, 2007 Author Share Posted July 11, 2007 The form will automatically pass any input values to the next page.I'd used the following: <a href="link.php?search> aa </a>it works fine, but I'd a text box named searchWordson the new page, I'd used $_GET['searchWords'], I tried to echo that variable , but nothing happens.. Link to comment Share on other sites More sharing options...
shlomk'e Posted July 11, 2007 Share Posted July 11, 2007 lets say you have in one page form: <from method=get action=other_page.php target=_blank><input type=text name=keyword /><input type=submit /></form> you want to get the value of the keyword in other_page.phpso: <?php$keyword = $_GET['keyword'];echo $keyword; // Should work fine...?> Link to comment Share on other sites More sharing options...
justsomeguy Posted July 11, 2007 Share Posted July 11, 2007 I'd used the following: <a href="link.php?search> aa </a>it works fine, but I'd a text box named searchWordson the new page, I'd used $_GET['searchWords'], I tried to echo that variable , but nothing happens..Clicking on a link does not submit the form, if you want the words in the input box to be passed to the next page you need to submit the form, not just click a link. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.