keeping selection lists on page after reults generated

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
dhar
Forum Newbie
Posts: 2
Joined: Sat Jun 30, 2007 12:35 pm

keeping selection lists on page after reults generated

Post 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..
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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>
?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not sure what you're attempting to achieve. Is it maintaining the selections from the drop-downs?
dhar
Forum Newbie
Posts: 2
Joined: Sat Jun 30, 2007 12:35 pm

Post 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
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Posting to the same page...
Post Reply