Sarà sicuramente il caldo che mi ha cotto il cervello, ma questo problema è un'intero pomeriggio che cerco di risolverlo senza ottenere nulla.
Ho una pagina dove l'utente si può registrare:
questa rimanda alla pagina register.php che elabora i dati:codice:<form action="register.php" method="post"> <div align="center"> <table border="0" width="300"> <tr> <td>Username:</td> <td><input type="text" name="username"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password"></td> </tr> <tr> <td>Mail:</td> <td><input type="text" name="mail"></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" name="action" value="Invia"></td> </tr> </table> </div> </form>
La funzione reg_register() è all'interno del file reg.lib.php.codice:<? include ("config.inc.php"); include ("reg.lib.php"); $username=strtolower($_POST['username']); $password=md5(strtolower($_POST['password'])); $mail=strtolower($_POST['mail']); reg_register($username,$password,$mail); ?>
codice:<? function reg_register($username,$password,$mail){ $time=time(); echo $time; $id = reg_get_unique_id(); echo $id; $query="INSERT INTO utenti (username, password, temp, regdate, uid) VALUES ('$username','$password','1','$time','$id')"; $result=mysql_query($query) or die(mysql_error()); reg_send_confirmation_mail($mail, "ravelot@tiscali.it", $id); } function reg_send_confirmation_mail($to, $from, $id){ $msg = "Per confermare l'avvenuta registrazione, clicckate il link seguente:http://localhost/Articoli/autenticaz...onfirm.php?id=".$id."; mail($to, "Conferma la registrazione", $msg, "From: ".$from); } function reg_get_unique_id(){ list($usec, $sec) = explode(' ', microtime()); mt_srand((float) $sec + ((float) $usec * 100000)); return md5(uniqid(mt_rand(), true)); } function reg_confirm($id){ $query =" UPDATE utenti SET temp='0' WHERE uid='$id'"; mysql_query() or die(mysql_error()); } ?>
Quando eseguo la pagina, mi appare questo tipo di errore:
Parse error: parse error, unexpected T_STRING in c:\programmi\apache group\apache\test\nbht\reg.lib.php on line 14
Che diavolo può essere? possibile mi sia sfuggita una parentesi o un ";", oppure c'è qualcosa di sbagliato che non riesco a tovare?

Rispondi quotando