Il codice che ha scritto dreamweaver è il seguente:
<?php require_once('Connections/database_prova.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 ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
$deleteSQL = sprintf("DELETE FROM lista WHERE ID=%s",
GetSQLValueString($_GET['ID'], "int"));
mysql_select_db($database_database_prova, $database_prova);
$Result1 = mysql_query($deleteSQL, $database_prova) or die(mysql_error());
$deleteGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
mysql_select_db($database_database_prova, $database_prova);
$query_cancella_elenco = "SELECT * FROM lista";
$cancella_elenco = mysql_query($query_cancella_elenco, $database_prova) or die(mysql_error());
$row_cancella_elenco = mysql_fetch_assoc($cancella_elenco);
$totalRows_cancella_elenco = mysql_num_rows($cancella_elenco);
?><!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" />
<title>Documento senza titolo</title>
</head>
<body>
<?php do { ?>
<form id="form1" name="form1" method="post" action="">
<table border="0" cellspacing="2">
<tr>
<td><?php echo $row_cancella_elenco['nome']; ?></td>
<td><?php echo $row_cancella_elenco['cognome']; ?></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Elimina" /></td>
<td></td>
</tr>
</table>
</form>
<?php } while ($row_cancella_elenco = mysql_fetch_assoc($cancella_elenco)); ?></body>
</html>
<?php
mysql_free_result($cancella_elenco);
?>
Please aiutamiiiiiiiii!!!