PHP gevorderde |
|
Ik krijg deze fout: Er is iets fout in de gebruikte syntax bij ')' in regel 1.
Als ik naar localhost/register.php ga.
script:
<?php
include('connect.php');
if(!empty($_POST)){
$username=$_POST['username'];
$password=$_POST['password'];
$passwordtwo=$_POST['passwordtwo'];
$email=$_POST['email'];
$sql_query = "SELECT * FROM gebruikers WHERE email='".$email."';";
$result = mysql_query($sql_query);
if(mysql_num_rows($result) > 0) {
$text = "Het ingevulde email-adres bestaat al. U vulde $email in. <A HREF=\"" . $_SERVER["PHP_SELF"] . "\">Opnieuw registeren</A>";
die($text);
}
else{
$sql_query = "INSERT INTO gebruikers (id, password, email,) ";
$sql_query .="VALUES ('".$password."', '".$username."',);";
$result = mysql_query($sql_query) or die(mysql_error());
$text="Registration completed, to log in: <A HREF=\"login.php\">Login!</A>";
die($text);
}
}
?>
<?php include('connect.php'); $username=$_POST['username']; $password=$_POST['password']; $passwordtwo=$_POST['passwordtwo']; $email=$_POST['email']; $sql_query = "SELECT * FROM gebruikers WHERE email='".$email."';"; $text = "Het ingevulde email-adres bestaat al. U vulde $email in. <A HREF=\"" . $_SERVER["PHP_SELF"] . "\">Opnieuw registeren</A>"; } else{ $sql_query = "INSERT INTO gebruikers (id, password, email,) "; $sql_query .="VALUES ('".$password."', '".$username."',);"; $text="Registration completed, to log in: <A HREF=\"login.php\">Login!</A>"; } } ?>
|