Boss10 Posted October 9, 2012 at 02:43 PM Report #478414 Posted October 9, 2012 at 02:43 PM <?php echo "<h1>Registo</h1>"; $submit = @$_POST['submit']; // $fullname = @$_POST['fullname']; $username = @$_POST['username']; $password = @$_POST['password']; $repeatpassword = @$_POST['repeatpassword']; $date = date("Y-m-d"); if ($submit) { if ($fullname&&$username&&password&&$repeatpassword) { if ($password==$repeatpassword) { if (strlen($username>25||strlen($fullname)>25) { ------------------------------------------------------------------------- linha 28 echo "O comprimento do Username/Nome é demasiado longo!"; } else { if (strlen($password)>25||strlen($password)<6) { echo "A password deve ter entre 6 a 25 characters!"; } else { echo "Sucesso!"; } } else echo "As passwords não coincidem!"; } else echo "Por favor, preencha <b>todos</b> os campos"; } } ?> <html> <form action='register.php' method='POST'> <table> <tr> <td> Nome: </td> <td> <input type='text' name='fullname'> </td> </tr> <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> Repete a Password: </td> <td> <input type='password' name='repeatpassword'> </td> </tr> </table> <p> <input type='submit' name='submit' value='Regista-te'> </form> </html> Parse error: syntax error, unexpected '{' in D:\xampp\htdocs\login\register.php on line 28 Por Favor ajudem-me nisto, não consigo resolver...
pikax Posted October 9, 2012 at 02:46 PM Report #478415 Posted October 9, 2012 at 02:46 PM olha bem para esta linha: if (strlen($username>25||strlen($fullname)>25) { //como esta': if (strlen($username>25||strlen($fullname)>25) { //como deveria de estar if (strlen($username)>25 || strlen($fullname)>25) { 1 Report Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."
Boss10 Posted October 9, 2012 at 02:51 PM Author Report #478417 Posted October 9, 2012 at 02:51 PM Obrigado já está resolvido esse problema... Agora poderia me ajudar neste erro: Parse error: syntax error, unexpected T_ELSE in D:\xampp\htdocs\login\register.php on line 48
pikax Posted October 9, 2012 at 03:08 PM Report #478419 Posted October 9, 2012 at 03:08 PM tens um else sem um if, mete isso identado que descobres logo o problema Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now