Un saluto a tutti !!!
Sto creando uno script per estrazione di dati dal DB, ho scritto il seguente script (programa....)
a_ranking.php
Mi viene il form correttamente e scelgo in base alla lista "gara" e "anno"Codice PHP:
<!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=iso-8859-1" />
<style type="text/css">
input {font-size:8pt;}
</style>
</head>
<body>
<hr></hr>
<table border='1' align="center">
<form action="b_ranking.php" method="post">
<p align='center'>Inserire il danza e anno per la ranking</p>
<table width="50%" border='1' align="center">
<td align='center'><b>Scegli danza</b></td>
<?php
require('config.php');
// connessione e selezione db
$result = mysql_query("select distinct danza_ranking from ranking order by danza_ranking");
echo "<td align='center'><select name='gara'>";
while ($row = mysql_fetch_array($result))
{
$selected=($danza_ranking== $row['danza_ranking'])?'selected':'';
echo "<option value=\"{$row['id_ranking']}\" $selected>{$row['danza_ranking']}</option>";
}
echo "</select><tr>";
?>
<td align='center'><b>Scegli Anno</b></td>
<?php
// connessione e selezione db
$result = mysql_query("select distinct anno_ranking from ranking order by anno_ranking");
echo "<td align='center'><select name='anno'>";
while ($row = mysql_fetch_array($result))
{
$selected=($anno_ranking== $row['anno_ranking'])?'selected':'';
echo "<option value=\"{$row['id_ranking']}\" $selected>{$row['anno_ranking']}</option>";
}
echo "</select><tr>";
?>
</table>
<div align="center">
<hr>
<table width="10%" align='center' border="1" cellpadding="1" cellspacing="0" bgcolor='#ddd000' >
<td align='center'><input type="submit" name="Avanti!" value="Succ. >>>"></td>
</table>
</div>
</div>
</div>
</table>
</body>
</html>
Al momento del <submit> chiama lo script b_ranking.php, abbastanza semplice !!!
La cosa che non riesco a capire è perchè non trovo niente nelle variabili.Codice PHP:
<?php
$danza = $_POST['gara'];
$anno = $_POST['anno'];
echo "DANZA = $danza ANNO = $anno <br>";
?>
Dove sbaglio??![]()
![]()
Grazie in anticipo a chi mi dirà l'errore che commetto.