codice:
<?php
$data = date ("d - m - Y");
$username = $_GET ["login"];
include ("dbconnect.php");
$username = $_GET ["login"];
if (isset($_POST["nome"]){
$nom = $_POST ["nome"];
$cogno = $_POST ["cognome"];
$usern = $_POST ["user"];
$password = $_POST ["password"];
$email = $_POST ["email"];
if ($nom =="" and $cogno =="" and $usern =="" and $password=="")
{
echo "<script language> window.alert(\"Inserire tutti i campi\"); </script>";
}
else
{
$insert = "insert into login (nome,cognome,user,password,email)
values ('$nom','$cogno','$usern','$password','$email')";
mysql_query($insert) or die (mysql_error());
$check = mysql_query ("select * from login where nome = '$nom' and user = '$usern'")
or die (mysql_error());
while ($row = mysql_fetch_array ($check))
$checknome = $row ['nome'];
$checkcogn = $row ['cognome'];
$checkuser = $row ['user'];
echo "<script language> window.alert(\"Inserimento effettuato con successo\"); </script>";
}
} else {
?>
<html>
<body>
<form method ="post" action = "gestioneaccount.php?login=<? echo $username; ?>">
Nome : <input type="text" name="nome" size="27" style="font-family: Arial; font-size: 8 pt; font-weight: bold">
Cognome :<input type="text" name="cognome" size="27" style="font-family: Arial; font-size: 8 pt; font-weight: bold">
User:<input type="text" name="user" size="27" style="font-family: Arial; font-size: 8 pt; font-weight: bold">
Password :<input type="text" name="password" size="27" style="font-family: Arial; font-size: 8 pt; font-weight: bold"></td>
Email:<input type="text" name="email" size="27" style="font-family: Arial; font-size: 8 pt; font-weight: bold"></td>
<input type="submit" value="Invia" name="B1" style="font-family: Arial; font-size: 8 pt; font-weight: bold">
<input type="reset" value="Reset" name="B2" style="font-family: Arial; font-size: 8 pt; font-weight: bold
</form>
</body>
</html>
<? } ?>