Check my code, everytime I press submit it tells me...
Parse error: syntax error, unexpected T_STRING in /1111111111/2222222222222222222/33333333/444444444444444444444444444 on line 21
Its frustrating. I thought I had everthing right. Here's my php file:
<?php
$email = $_POST['email'];
if ($username == null ||$email == null ||$password == null )
{
die("You must fill out everything on the form!");
}
else
{
//continue...
}
$conn = mysql_connect("$############", "$############","$#############") or die(mysql_error());
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db("xxxxxxxxx_xxxxx", $conn);
$alreadyexists = mysql_query(SELECT password FROM login WHERE email = $email);
if ($alreadyexists != null)
{
die('This email has already been registered. Please use a different email.');
}
$alreadyexists = mysql_query(SELECT password FROM login WHERE username exist = $username);
if ($alreadyexists != null)
{
die('This username has already been registered. Please use a different email.');
}
mysql_query("INSERT INTO Persons (username,email,password)
VALUES ($username,$email,$password)");
}
?>
Do you find anything wrong, if so plz state and help me fix it, or provide an alternative registration form. Im using 000webhost, should I switch to another hosting provider because there connections are to hard to use.