Very simple question about HTTP Request

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
berniecc
Forum Newbie
Posts: 5
Joined: Thu Jun 19, 2003 5:38 am
Contact:

Very simple question about HTTP Request

Post by berniecc »

How can I retrieve, in a server side php, the selected options of a multiple select? i mean, could you specify a simple code to do it?

Thanx in advance.
Bernie.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

<html>
	<head><title>example</title></head>
	<body>
		<pre><?php if (isset($_POST['multisel'])) print_r($_POST['multisel']); ?></pre>
		<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
			<select name="multisel[]" multiple="multiple">
				<option>a</option>
				<option>b</option>
				<option>c</option>
				<option>d</option>
				<option>e</option>
			</select>
			<input type="submit" />
		</form>
	</body>
</html>
the import part is [] appended to the name property of <select>
Post Reply