Jump to content

Send more than two parameter to an page


bemax

Recommended Posts

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'];

 

Link to comment
https://forums.phpfreaks.com/topic/116039-send-more-than-two-parameter-to-an-page/
Share on other sites

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']

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">&#8727;</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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.