scusa l'ignoranza.....dove metto GET? e la query? che significa fare il ciclo e stampare con select?
il codice attuale con la prima modica da te suggerita (senza query e senza GET) è questo:
<?php require_once('Connections/server.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_server, $server);
$query_rs_nomeitinerario = "SELECT itinerarioID, nomeitinerario, nazioni FROM tbl_itinerari ORDER BY nomeitinerario ASC";
$rs_nomeitinerario = mysql_query($query_rs_nomeitinerario, $server) or die(mysql_error());
$row_rs_nomeitinerario = mysql_fetch_assoc($rs_nomeitinerario);
$totalRows_rs_nomeitinerario = mysql_num_rows($rs_nomeitinerario);
mysql_select_db($database_server, $server);
$query_rs_nazioni = "SELECT nazioneID, nomenazione FROM tbl_nazioni ORDER BY nomenazione ASC";
$rs_nazioni = mysql_query($query_rs_nazioni, $server) or die(mysql_error());
$row_rs_nazioni = mysql_fetch_assoc($rs_nazioni);
$totalRows_rs_nazioni = mysql_num_rows($rs_nazioni);
mysql_select_db($database_server, $server);
$query_rs_nomecontinente = "SELECT continenteID, nomecontinente FROM tbl_continenti ORDER BY nomecontinente ASC";
$rs_nomecontinente = mysql_query($query_rs_nomecontinente, $server) or die(mysql_error());
$row_rs_nomecontinente = mysql_fetch_assoc($rs_nomecontinente);
$totalRows_rs_nomecontinente = mysql_num_rows($rs_nomecontinente);
?><!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>
<title>Itinerari</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="mm_travel2.css" type="text/css" />
<script language="JavaScript" type="text/javascript">
//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("Gennaio","Febbraio","Marzo","Aprile","Maggi o","Giugno","Luglio","Agosto","Settembre","Ottobre ","Novembre","Dicembre");
//Ensure correct for language. English is "1 Gennaio, 2004"
var TODAY = d.getDate() + " " + monthname[d.getMonth()] + " " + d.getFullYear();
//--------------- END LOCALIZEABLE ---------------
</script>
</head>
<body bgcolor="#C0DFFD">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#3366CC">
<td colspan="3" rowspan="2">[img]mm_travel_photo.jpg[/img]</td>
<td height="63" colspan="3" align="center" valign="bottom" nowrap="nowrap" id="logo"><div align="center"><span class="pageName Stile8"><span class="pageName Stile10"><span class="pageName Stile8"><span class="pageName Stile14"><span class="pageName Stile16"><span class="pageName Stile14"><span class="pageName Stile8 Stile23"> Itinerari nel Mondo </span></span></span></span></span></span></span></div></td>
<td width="252"></td>
</tr>
<tr bgcolor="#3366CC">
<td height="55" colspan="3" id="tagline" valign="top" align="center"></td>
<td width="252"></td>
</tr>
<tr>
<td colspan="7" bgcolor="#003366">[img]mm_spacer.gif[/img]</td>
</tr>
<tr bgcolor="#CCFF99">
<td colspan="7" id="dateformat" height="25"><script language="JavaScript" type="text/javascript">
document.write(TODAY); </script> </td>
</tr>
<tr>
<td colspan="7" bgcolor="#003366">[img]mm_spacer.gif[/img]</td>
</tr>
<td width="380"></span></td>
</tr> <tr>
<td></td>
</tr>
</table>
<div class="navText Stile54" id="menuorizzontale">
<p align="center" class="bodyText"> Home / I Nostri Viaggi / Forum / Guestbook / Newsgroup / Utilink</p>
</div>
<div id="contactus">
<p class="subHeader">Contact Us | 2007 Marco & Gabriella </p>
</div>
</p>
<table width="27%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<th height="27" valign="middle" scope="col"><span class="Stile56">Cerca l'itinerario </span></th>
</tr>
</table>
</p>
</p>
<table width="95%" border="1" align="center" cellpadding="3" cellspacing="0">
<tr>
<td width="41%">Per Continente </td>
<td width="59%"><form id="frm_percontinente" name="frm_percontinente" method="post" action="">
funzione attualmente non disponibile
</form> </td>
</tr>
<tr>
<td>Per Nazione o Regione italiana </td>
<td><select name="nomenazione" id="nomenazione" onchange="window.location = ('<?php echo $_SERVER['PHP_SELF']; ?>?IDnazione=+nomenazione.options[this.selectedIndex].value')">>
<?php
do {
?>
<option value="<?php echo $row_rs_nazioni['nazioneID']?>"><?php echo $row_rs_nazioni['nomenazione']?></option>
<?php
} while ($row_rs_nazioni = mysql_fetch_assoc($rs_nazioni));
$rows = mysql_num_rows($rs_nazioni);
if($rows > 0) {
mysql_data_seek($rs_nazioni, 0);
$row_rs_nazioni = mysql_fetch_assoc($rs_nazioni);
}
?>
</select></td>
</tr>
<tr>
<td>Scegli tra tutti gli itinerari </td>
<td><form id="frm_peritinerario" name="frm_peritinerario" method="post" action="itinerari_dettagli.php">
<select name="nomeitinerario" id="nomeitinerario">
<?php
do {
?><option value="<?php echo $row_rs_nomeitinerario['itinerarioID']?>"><?php echo $row_rs_nomeitinerario['nomeitinerario']?></option>
<?php
} while ($row_rs_nomeitinerario = mysql_fetch_assoc($rs_nomeitinerario));
$rows = mysql_num_rows($rs_nomeitinerario);
if($rows > 0) {
mysql_data_seek($rs_nomeitinerario, 0);
$row_rs_nomeitinerario = mysql_fetch_assoc($rs_nomeitinerario);
}
?>
</select>
<input name="Invia" type="submit" id="Invia" value="Invia" />
</form> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rs_nomeitinerario);
mysql_free_result($rs_nazioni);
mysql_free_result($rs_nomecontinente);
?>