MDanz Posted June 7, 2011 Share Posted June 7, 2011 With this form... if i typed in "new test" in the search text field the url would come up as test.php?search=new+test How do i get the url to replace spaces as a dash instead of a plus sign? <form action="test.php" method="GET" name="searchbar"> <?php $search = strtolower($_GET['search']); $formpage = $_SERVER['PHP_SELF']; echo "<input type='text' size='40' name='search' style='font-size:16px; font-family:Arial;font-weight:bold;' /> <input type='submit' value='Search' style='font-size:14px;' />"; ?> </div> </form> Link to comment https://forums.phpfreaks.com/topic/238676-str_replace-with-form-help/ Share on other sites More sharing options...
fugix Posted June 7, 2011 Share Posted June 7, 2011 a plus sign represents a space character in the url..why do you need to change the character? Link to comment https://forums.phpfreaks.com/topic/238676-str_replace-with-form-help/#findComment-1226526 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.