bemax Posted July 22, 2008 Share Posted July 22, 2008 Is anyone who kan show me how I can send more than 2 parameters to another page? I having trouble with this. I have a search in a page.( navigation.php). Here is a dropdown. I want to send the dropdow parameter with the search word to a page called (search.php) page. Here is the script I'm having problem with <form action="contents.php?id=11 & par1={$mot} & par2= {$ou}" method="post"> Recherche<br/> <input type="text" name="search"/><br/> <select name="fields"> <option>Actualité</option> <option>Annonces</option> <option>Culture</option> <option>Ecrivains</option> <option>Musique</option> <option>Art</option> <option>Contes</option> </select> <input type="submit" name="submit" value="chercher"/> </form> <?php if(isset($_POST['submit'])) { $mot = $_GET['name']; $ou = $_GET['fields']; Quote Link to comment https://forums.phpfreaks.com/topic/116039-send-more-than-two-parameter-to-an-page/ Share on other sites More sharing options...
DarkWater Posted July 22, 2008 Share Posted July 22, 2008 This doesn't belong in the OOP board, by the way. And why not just use POST? Quote Link to comment https://forums.phpfreaks.com/topic/116039-send-more-than-two-parameter-to-an-page/#findComment-596671 Share on other sites More sharing options...
corbin Posted July 23, 2008 Share Posted July 23, 2008 ?var1=val1&var2=val2&var3=val3 Quote Link to comment https://forums.phpfreaks.com/topic/116039-send-more-than-two-parameter-to-an-page/#findComment-597130 Share on other sites More sharing options...
bemax Posted July 28, 2008 Author Share Posted July 28, 2008 Thanks Corbin; I'm trying with what you proposed to me(?var1=val1&var2=val2&var3=val3) but it doesen't work! Can you please try with my code and se what happen. Quote Link to comment https://forums.phpfreaks.com/topic/116039-send-more-than-two-parameter-to-an-page/#findComment-601933 Share on other sites More sharing options...
wildteen88 Posted July 28, 2008 Share Posted July 28, 2008 Is anyone who kan show me how I can send more than 2 parameters to another page? I having trouble with this. I have a search in a page.( navigation.php). Here is a dropdown. I want to send the dropdow parameter with the search word to a page called (search.php) page. Here is the script I'm having problem with <form action="contents.php?id=11 & par1={$mot} & par2= {$ou}" method="post"> Recherche<br/> <input type="text" name="search"/><br/> <select name="fields"> <option>Actualité</option> <option>Annonces</option> <option>Culture</option> <option>Ecrivains</option> <option>Musique</option> <option>Art</option> <option>Contes</option> </select> <input type="submit" name="submit" value="chercher"/> </form> <?php if(isset($_POST['submit'])) { $mot = $_GET['name']; $ou = $_GET['fields']; $_GET['name'] and $_GET['fields'] should be $_POST['name'] and $_POST['fields'] Quote Link to comment https://forums.phpfreaks.com/topic/116039-send-more-than-two-parameter-to-an-page/#findComment-601970 Share on other sites More sharing options...
bemax Posted August 1, 2008 Author Share Posted August 1, 2008 I tried but I could not succed. The problem that I have 2 pages: navigation.php - where I have my form - this form has input=the word to search and an other parameter which specify where to search. search.php where I want to send the data(parameters) and display the result from database. This side is not visible in what I send to you. It's id=11 which is send from contents.php(here is a function with ids corresponding to every page). I think you understand my idea. The page navigation is on the right and when visitors put a word to search, this is send to search and here I will use the variables to get data from database.(This is not a big problem to me - only get my parameters in the search.php page from navigation.php) Here is the code of navigation.php <table> <tr> <td> <!--<form action="search.php?id='11' && $mot && $ou" method="post">--> <form action="contents.php?id=11 && par1={$mot} && par2= {$ou}" method="get"/> <p class="pUnderLine"><b class="asterisk">∗</b> Recherche<br/> <input type="text" name="search"/><br/> <select name="fields"> <option value="Actualite">Actualité</option> <option value="Annonces">Annonces</option> <option value="Culture">Culture</option> <option value="Ecrivains">Ecrivains</option> <option value="Musique">Musique</option> <option value="Art">Art</option> <option value="Contes">Contes</option> </select> <input type="submit" name="submit" value="chercher"/> </p> </form> <?php if(isset($_POST['submit'])) { $mot = $_POST['name']; $ou = $_POST['fields']; echo $mot; echo $ou; } ?> </td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/116039-send-more-than-two-parameter-to-an-page/#findComment-605576 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.