0

Hello,
I have a page say 03.htm where I have a hyperlink to notes.php .In notes.php I have a dropdown menu which has a collection of all pages from 01-20 ,where I have to choose between 01-20.What I want is that since I clicked hyperlink from 03.htm the dropdown menu must set its default selected value to 03.If I clicked hyperlink from 10.htm the dropdown menu in notes.php must set its default selected value to 10 such that user does not have to select the page number in the drop down menu .. and its automatically done by default..Please help !
Thanks ..

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by R0bb0b
0
<?
$pages = array();
for($i = 0; $i < 20; $i++)
{
	$page = $i;
	if($page < 10)
	{
		$page = "0" . $page;
	}
	$pages[] = $page;
}
?>

<select name="selPage" id="selPage">
	<?
	foreach($pages as $page)
	{
	?>
		<option<?
		if(strpos($_SERVER['HTTP_REFERER'], $page . ".htm") !== false)
		{
			echo ' selected="selected"';
		}
		?> value="<? echo $page . ".htm"; ?>"><? echo $page . ".htm"; ?></option>
	<?
	}
	?>
</select>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.