Page 1 of 1

keeping selection lists on page after reults generated

Posted: Sat Jun 30, 2007 1:00 pm
by dhar
Hi,

I'm new to php, new to this forum....I would like to create 2 single-select drop-down selection boxes on a page

box1 - select academic year from 2001, 2002 , 2003 etc

box2 - select semester from 1, 2, 3 etc

As a result course details for all courses that satisfy these selection values get displayed below the boxes. The boxes remain availabel on the page. The user should be able to re-set these boxes to different values to generate different results. The boxes remain visible on the page..

Is this possible ?? I would appreciate any feedback...info.....script.....link to help..etc. thanks alot..

Posted: Sat Jun 30, 2007 1:27 pm
by volka
I'm not sure what the question is. Do you want something like

Code: Select all

<?php
if ( !defined('DATE_ATOM') ) define('DATE_ATOM', 'Y-m-d\TH:i:sP');
if ( !defined('DATE_RFC850')) define('DATE_RFC850', 'l, d-M-y H:i:s T');
if ( !defined('DATE_RFC1036') ) define('DATE_RFC1036', 'D, d M y H:i:s O');
if ( !defined('DATE_W3C') ) define('DATE_W3C', 'Y-m-d\TH:i:sP');
?>
<html>
	<head><title>...</title></head>
	<body>
		<form method="post" action="?">
			<div>
				<select name="s1">
					<option>DATE_ATOM</option>
					<option>DATE_RFC850</option>
					<option>DATE_RFC1036</option>
					<option>DATE_W3C</option>
				</select>
				<select name="s2">
					<option>0</option>
					<option>1</option>
					<option>2</option>
					<option>3</option>
				</select>
				<input type="submit" />
			</div>
		</form>
<?php
if ( isset($_POST['s1'], $_POST['s2']) && defined($_POST['s1']) ) {
	$ts = time() + 86400*(int)$_POST['s2'];
	echo '<div>', date(constant($_POST['s1']), $ts), "</div>\n";
}
?>
	</body>
</html>
?

Posted: Sat Jun 30, 2007 1:28 pm
by feyd
I'm not sure what you're attempting to achieve. Is it maintaining the selections from the drop-downs?

Posted: Sat Jun 30, 2007 5:57 pm
by dhar
I apologize if my question is not clear.e

just to re-cap ....a user selects a value from both drop-down lists. A table or list of courses gets displayed below
these drop-downs.

Is there a way to keep the drop-downs active/visible on the page so that the user can re-select from the drop-downs to get a refreshed list of courses...below..

is this any clearer ??? ....sorry for the inconvenience... thanks

Posted: Sat Jun 30, 2007 6:03 pm
by superdezign
Posting to the same page...