ctcp Posted July 29, 2009 Share Posted July 29, 2009 i got texfield (for search) list menu (1 or 2) and Button (Search) how to if i search test type 1 (i whant this result to my page) mysite.com/1/?query=test&type=1 if i search test type 2 (i whant this result to my page) mysite.com/2/?query=test&type=2 <form name="form1" method="get" action=""> <label for="query1"></label> <input type="text" name="query1" id="query1"> <label for="type"></label> <select name="type" id="type"> <option value="1">1</option> <option value="2">2</option> </select> <label for=""></label> <input type="submit" value="Search"> </form> Thanks for the Help Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/ Share on other sites More sharing options...
ctcp Posted July 29, 2009 Author Share Posted July 29, 2009 bump Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886382 Share on other sites More sharing options...
fooDigi Posted July 29, 2009 Share Posted July 29, 2009 to clarify... if you select 1 from the list it will go to the first search results page (ex 1-10 of 20), and 2 will go to the second results page (11-20 of 20)? Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886385 Share on other sites More sharing options...
ctcp Posted July 30, 2009 Author Share Posted July 30, 2009 no you don't understant .. i got 2 directoris one is test1 and test2 i whant make one texfield list menu search button if i search for TEST (texfield) and select options 1 (form list menu) i whant my search redirect me to mysite.com/test1/?query=test&type=1 type is my options from list menu if i search for TEST (texfield) and select options 1 (form list menu) i whant my search redirect me to test2/?query=test&type=2 Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886400 Share on other sites More sharing options...
fooDigi Posted July 30, 2009 Share Posted July 30, 2009 ok, i understand now i think... you could do this with javascript... but to accomplish it with php, have an intermediary page, that will check the value of $_GET['type'] and use a header redirect accordingly... example... header("Location: /test".$_GET['type']."/?query=".$_GET['query']."&type=".$_GET['type']); hope that helps... Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886410 Share on other sites More sharing options...
ctcp Posted July 30, 2009 Author Share Posted July 30, 2009 not help but thanks mate alot maybe sombady help me :-) Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886437 Share on other sites More sharing options...
patrickmvi Posted July 30, 2009 Share Posted July 30, 2009 It's hard to understand what you want to do, I think foo gave some good explanations. If those are off, then what you're explaining must be off... Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886439 Share on other sites More sharing options...
ctcp Posted July 30, 2009 Author Share Posted July 30, 2009 It's hard to understand what you want to do, I think foo gave some good explanations. If those are off, then what you're explaining must be off... can help me pls how to? im new in php header("Location: /test".$_GET['type']."/?query=".$_GET['query']."&type=".$_GET['type']); add this line where? Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886442 Share on other sites More sharing options...
fooDigi Posted July 30, 2009 Share Posted July 30, 2009 ok, keep your form action empty... and place this at the very top of the same script... if(isset($_GET['type'])) { header("Location: /test".$_GET['type']."/?query=".$_GET['query']."&type=".$_GET['type']); } now that should redirect once you submit, and you should see it try and redirect accordingly... Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886449 Share on other sites More sharing options...
ctcp Posted July 30, 2009 Author Share Posted July 30, 2009 thanks mate alot Link to comment https://forums.phpfreaks.com/topic/168051-solved-php-list-menu-pls-help/#findComment-886463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.