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.

------------------------------------------------------------------------------

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

---------------------------------------------------------------------------
Thanks for anyone will help me.
Temax

Recommended Answers

All 4 Replies

Each option should have an associated value. For example:

<option>Actualité</option>

should be

<option value="Actualité">Actualité</option>

Also, if you want to add variables to the url, use method="get". This will automatically place the variables into the query string.

by this line:
<select name="fields">
</select>


you can retrieve the option value by $_POST ..

In form tag you should use action as action="search.php".

Thanks Shanti
I don't use search.php because I get it throuth id=11. that means it's 3 parameters. I will try your suggestion and tell you what happened.
Temax

I don't understand what you are trying to do. Will this not work for you?

<form action="contents.php?id=11" method="get">
			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($_GET['submit']))
					{
						$mot = $_GET['search'];
						$ou = $_GET['fields'];
						echo "mot=$mot<br>";
						echo "ou=$ou";
						}
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.