Buongiorno, ho realizzato un form di registrazione per un mio sito in HTML, con reindirizzamento su un file php, che inserisce i dati all'interno di un database, il problema è che visualizzo la pagina, compilo, premo registrati, mi reindirizza, ma mi restituisce pagina bianca...
il file php lo metto sotto perché me lo formatta male
se qualcuno mi può dare una mano ne sarei grato...
grazie in anticipo
- - - Updated - - -
Codice:
[FONT=Helvetica]<html>[/FONT][FONT=Helvetica]<head>[/FONT]
[FONT=Helvetica]<meta charset="utf-8">[/FONT]
[FONT=Helvetica]<link rel="stylesheet" type="text/css" href="style.css">[/FONT]
[FONT=Helvetica]<title></title>[/FONT]
[FONT=Helvetica]</head>[/FONT]
[FONT=Helvetica]<body>[/FONT]
[FONT=Helvetica]<h2 style="text-align: center;">Registrazione</h2>[/FONT]
[FONT=Helvetica]<form name="form_registration" method="post" action="registrati.php"><br>[/FONT]
[FONT=Helvetica]<p style="text-align: center;">Username: <br>[/FONT]
[FONT=Helvetica]<input name="user" type="text"></p>[/FONT]
[FONT=Helvetica]<br>[/FONT]
[FONT=Helvetica]<p style="text-align: center;">Email: <br>[/FONT]
[FONT=Helvetica]<input name="email" type="text"></p>[/FONT]
[FONT=Helvetica]<br>[/FONT]
[FONT=Helvetica]<p style="text-align: center;">Password: <br>[/FONT]
[FONT=Helvetica]<input name="pass1" type="password"></p>[/FONT]
[FONT=Helvetica]<br>[/FONT]
[FONT=Helvetica]<p style="text-align: center;">Ripeti Password: <br>[/FONT]
[FONT=Helvetica]<input name="conferma" type="password"></p>[/FONT]
[FONT=Helvetica]<div style="text-align: center;"><button>Registrati</button> </div>[/FONT]
[FONT=Helvetica]</form>[/FONT]
[FONT=Helvetica]</body>[/FONT]
[FONT=Helvetica]</html>[/FONT]
il file php lo metto sotto perché me lo formatta male
se qualcuno mi può dare una mano ne sarei grato...
grazie in anticipo
- - - Updated - - -
PHP:
<?php$nomehost = “localhost”;$nomeuser = “root”;$password = “...”;$dbname = “utenti”;$connessione = mysql_connect($nomehost,$nomeuser,$password);
if($connessione == 0) { echo “connessione fallita”;}
$database_select=mysql_select_db($dbname,$connessione);if($database_select == 0) {echo “selezione non riuscita”;}
$user = ($_POST[‘user’]);$mail = ($_POST[‘email’]);$pass1 = ($_POST[‘pass1’]);$conferma = ($_POST[‘conferma’]);
if($pass1!=$conferma) { echo “password non corrispondenti”;}
else {
if($user == ”” or $mail == "" or $pass1 == "" or $conferma ==“”){
echo “tutti i campi sono obbligatori”. “<br>” . ‘<a href=“http://buzzi2h.ovh/sito/prova.php”>ritorna indietro</a>’;}
else {
$query = “ Insert into ‘tabella_registrati’ (‘user’ , ‘email’ , ‘password’) VALUES (‘$user’,’$mail’,’$pass1)”;
$result=mysql_query($query,$connessione);
if($result == 0) die (“errore di registrazione”);
else
header(“location:prova.php”);
}}?>
Ultima modifica: