Here's my code:
<?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;
}
?>
With this, I'm getting
Parse error: syntax error, unexpected $end in /mylocation/index.php on line 1
I've checked all the branches and I can't find anything.
Did I miss something?