Se a qualcuno serve ho la pagina funzionante che fissa anche il bug dell'url:
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento senza titolo</title>
<script type="text/javascript">
function GetUrlVars(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.href); if (results == null) { return ""; } else { return results[1]; } }
if (GetUrlVars('value') != '') { };
</script>
</head>
<body>
<div>
<select name="selTitle" id="titles" onchange="if ((this.options[this.selectedIndex].value != '-1') && (this.options[this.selectedIndex].value != GetUrlVars('value'))) {window.location = '//' + location.host + location.pathname + '?value=' + this.options[this.selectedIndex].value;}">
<option value="-1">-- Choose an option --</option>
<option value="00">First</option>
<option value="01">Second</option>
<option value="02">Third</option>
<option value="03">Fourth</option>
<option value="04">Fifth</option>
</select>
</div>
<?
$cardinali=$_GET['value'];
echo ("$cardinali
");
?>
</body>
</html>