这是我的代码:
<?php
if(empty($_POST['id']))
{
echo '<form method="post"><input type="text" name="id"><input type="submit" value="go"></form>';
}
else
{
$con=mysqli_connect("localhost","adminuser","adminpassword","database");
// Check connection
if (mysqli_connect_errno())
{
die("dbconnect failed: " . mysqli_connect_error());
}
$remoteEndpoint=$_SERVER["REMOTE_ADDR"].".".$_SERVER["REMOTE_PORT"];
$hash = md5(uniqid());
$code= mysql_real_escape_string($_POST['id']);
mysqli_query($con,"INSERT INTO `mobile` (`useragent`, `ip`, `hash`) VALUES ('".$code."', '".$remoteEndpoint."','".$hash."')");
echo hash;
}
?>
有了这个,我得到
Parse error: syntax error, unexpected $end in /mylocation/index.php on line 1
我已经检查了所有分支,但找不到任何东西。
我错过了什么?