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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.