onlyican Posted September 9, 2006 Share Posted September 9, 2006 Hey guysHeres a good questionI have a page which looks like this in realfriends.php?l=All&p=1I made it look nice with Mod ReWriteSo nowfriends/All/1NowThe All us a search fuctionThey can choose to look at all profilesOr just Disabled PeopleOr Just Parentsectif I create the form<form method='get' action=''><select name='l'><option>All</option><option value='Disabled_People'>Disabled People</option></select>If I select Disabled People for example, then it will mess up, it will show like sofriends/All/1?l=Disabled_PeopleThe page linking works ok, as its linksAnyone have any suggestions on how I can do this? Link to comment https://forums.phpfreaks.com/topic/20219-using-get-in-form-on-mod-rewrite/ Share on other sites More sharing options...
onlyican Posted September 9, 2006 Author Share Posted September 9, 2006 Anyone??? Link to comment https://forums.phpfreaks.com/topic/20219-using-get-in-form-on-mod-rewrite/#findComment-88997 Share on other sites More sharing options...
jefkin Posted September 9, 2006 Share Posted September 9, 2006 You could throw a little javascript in your form:This may not work for you out of the box, but I'm sure you could tweak it! :)[code]<form method='get' id="search_form" action=''><input type="hidden" id="my_i" name="which" value="<?= $_REQUEST['p'] ?>" /><!-- put a script tag here!!! (script) -->function search(){ i = document.getElementById('my_i').value; sel = document.getElementById('select_srch'); form = document.getElementById('search_form"); form.action = "friends/" + sel.options[sel.selectedIndex].value + "/" + i; form.submit();}</script><select name='l' id="select_srch" onChange="javascript: search();"><option>All</option><option value='Disabled_People'>Disabled People</option></select></form>[/code]Jeff Link to comment https://forums.phpfreaks.com/topic/20219-using-get-in-form-on-mod-rewrite/#findComment-89036 Share on other sites More sharing options...
onlyican Posted September 9, 2006 Author Share Posted September 9, 2006 ExcellentI just changed the method to postas it put other crap in therebut it works a dreamMany many many thanx Link to comment https://forums.phpfreaks.com/topic/20219-using-get-in-form-on-mod-rewrite/#findComment-89043 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.