Ciao a tutti,
ho creato una tabella che stampa dei dati salvati su un database. Quello che vorrei fare è di dare la possibilità agli utenti di poter modificare alcuni dati.
Nella tabella ho aggiunto un link edit al quale si collega ad un'altra pagina che permette di inserire i dati da sostituire, una volta modificato il dato e cliccato il submit button si collega ad un'altra pagina ancora che stampa i dati salvati e al tempo stesso esegue la modifica sul database. Il mio problema è che quest'ultimo passaggio non funziona ossia ritorna un errore:
Server error.
The website encountered an error while retrieving http://192.168.1.100/intranet/mod.php. It may be down for maintenance or configured incorrectly.
here are some suggestions:
Reload this web page later.
More information on this error
e non modifica nulla sul database. Io credo ci sia un errore in questo codice ma non riesco a capire cosa:
Codice PHP:
<?php
$id=$_POST["id"] ;
$Nome = $_POST["Nome"];
$Email = $_POST["Email"];
$NumeroCell = $_POST["NumeroCell"];
$InternoTemis = $_POST["InternoTemis"];
$Skype = $_POST["Skype"];
if($Nome=="")
{
print "Nome obbligatorio
<a href=\"?page_id=321\">indietro</a>";
}
elseif($Email=="")
{
print "La mail obbligatoria
<a href=\"?page_id=321\">indietro</a>";
print "Numero Cell: $NumeroCell
";
print "Interno Temis: $InternoTemis
";
print "Skype: $Skype
";
}
else
{
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '*******';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting
to mysql');
$dbname = 'wordpress';
mysql_select_db($dbname);
mysql_query("UPDATE temis_contatti SET Nome='$Nome', Email='$Email', NumeroCell='$NumeroCell',
InternoTemis='$InternoTemis', Skype='$Skype' WHERE id=$id");
mysql_close();
?>
<html>
<head>
<title>update</title>
</head>
<body>
<table width="750" align="center">
<tr>
<td>
<?php
echo "Record modificato:
";
echo "Nome: $Nome
";
echo "Email: $Email
";
echo "Numero Cell: $NumeroCell
";
echo "InternoTemis: $InternoTemis
";
echo "Skype: $Skype
";
?>
[url="\?page_id=311"]Elenco completo[/url]
</td>
Potreste darmi una mano Grazie