检查我的代码,每次我按下提交它都会告诉我......
解析错误:语法错误,第 21 行 /1111111111/2222222222222222222/33333333/444444444444444444444444444 中的意外 T_STRING
它令人沮丧。我以为我做对了。这是我的 php 文件:
<?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)");
}
?>
您是否发现任何问题,如果有,请说明并帮助我修复它,或提供替代注册表单。我使用 000webhost,我应该切换到另一个托管服务提供商,因为那里的连接很难使用。