Exoon Posted September 6, 2010 Share Posted September 6, 2010 Hello, Im trying to have my search on my site so the URL goes to index.php?page=search&string=WhatEverWasTyped How is this possible? Link to comment https://forums.phpfreaks.com/topic/212689-search-with-string-in-url/ Share on other sites More sharing options...
DarkMantis Posted September 6, 2010 Share Posted September 6, 2010 Make the search Parameter a GET instead of POST like so: $search = stripslashes($_GET['search']); //Sanitize! and use a SELECT sql statement in to check your DB. Then voila. xx Link to comment https://forums.phpfreaks.com/topic/212689-search-with-string-in-url/#findComment-1107928 Share on other sites More sharing options...
Exoon Posted September 6, 2010 Author Share Posted September 6, 2010 So i put that <form name="search" method="post" action="/search/<? $_GET['search']; ?>"> Like this ? Link to comment https://forums.phpfreaks.com/topic/212689-search-with-string-in-url/#findComment-1107936 Share on other sites More sharing options...
nethnet Posted September 6, 2010 Share Posted September 6, 2010 Just make the method of your form GET instead of POST. Link to comment https://forums.phpfreaks.com/topic/212689-search-with-string-in-url/#findComment-1108040 Share on other sites More sharing options...
Hypnos Posted September 7, 2010 Share Posted September 7, 2010 Hello, Im trying to have my search on my site so the URL goes to index.php?page=search&string=WhatEverWasTyped How is this possible? <form action="index.php" method="get"> <input type="text" name="string"/> <input type="hidden" name="page" value="search"/> <input type="submit" value="Search"/> </form> Link to comment https://forums.phpfreaks.com/topic/212689-search-with-string-in-url/#findComment-1108069 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.