Jump to content

Recommended Posts

Posted
<?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...

Posted

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)
{
  • Vote 1

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."

Posted

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

Posted

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."

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.