Jump to content

Jump menu problem


ayok

Recommended Posts

Hi, I make a jump menu with the options based on mysql database.

The jump menu is working, however, when it gets to the selected page, the "selected" option is back to the first page.

This is my try:

$payment = mysql_query("select * from payment") or die(mysql_error());
echo"<select name=\"pay\" onchange=\"MM_jumpMenu('parent',this,0)\">
          <option value=''>Select method</option>";
$amount = $_GET['pay'];
while($pay = mysql_fetch_array($payment)){
	echo "<option value=cart.php?pay=$pay[pay_id]";
	if(!(strcmp("cart.php?pay=$pay[pay_id]",$_GET['pay']))){ 
		echo "selected";
	}
	echo ">$pay[type]</option>";
}
echo "</select>

So everytime it jumps to the other pages, the selection always back to "Select method" option.

What should I do to make the selection stay in each option selected?

 

Thank you,

ayok

Link to comment
https://forums.phpfreaks.com/topic/92760-jump-menu-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.