I am having trouble with this page:

<?php
session_start();

// LOGIN PAGE...

include('/mods/core/core_login.php');

// SQL stuff.
mysql_connect('SQL host','Username','Password');
mysql_select_db('DB_NAME');

$ci = rand(1, 10);

if ($ci == "1"){

        $img = "http://images.awsomechat.comuv.com/cap_1.png"; // URL of image.
        $ans = "LoIs DDiO"; // Answer to image.

}elseif ($ci == "2"){

        $img = "http://images.domain.com/cap_2.png"; // URL of image.
        $ans = "SFBoTs SSDi"; // Answer to image.

}elseif ($ci == "3"){

        $img = "http://images.domain.com/cap_3.png"; // URL of image.
        $ans = "LOWR D."; // Answer to image.

}elseif ($ci == "4"){

        $img = "http://images.domain.com/cap_4.png"; // URL of image.
        $ans = "Wart BLOORT"; // Answer to image.

}elseif ($ci == "5"){

        $img = "http://images.domain.com/cap_5.png"; // URL of image.
        $ans = "Fast Ou3"; // Answer to image.

}elseif ($ci == "6"){

        $img = "http://images.domain.com/cap_6.png"; // URL of image.
        $ans = "Floor It"; // Answer to image.

}elseif ($ci == "7"){

        $img = "http://images.domain.com/cap_7.png"; // URL of image.
        $ans = "Zombies Eat"; // Answer to image.

}elseif ($ci == "8"){

        $img = "http://images.domain.com/cap_8.png"; // URL of image.
        $ans = "Real Glo" // Answer to image.

}elseif ($ci == "9"){

        $img = "http://images.domain.com/cap_9.png"; // URL of image.
        $ans = "route Aloy"; // Answer to image.
}


$errors = array();

if (isset($_POST['username'], $_POST['password'])){


   $user = $_POST['username'];
   $pass = $_POST['password'];

   if (empty($_POST['username'])){
     $errors[] = 'The username field is empty.';
   }
   if (empty($_POST['password'])){
     $errors[] = 'The password field is empty.';
   }

   if (valid($_POST['username'], sha1($_POST['password'])) == false){ //Test 1
      $errors[] = 'Username or password is incorrect.';
      $val = $val - 1;
    }

   if (empty($errors)){

     setcookie('username', $_POST['username'], time() + 3600);
     setcookie('password', sha1($_POST['password']), time() + 3600);

     $mod_name = $_POST['username'];
     session_register("mod_name");

     header( 'Location: http://www.domain.com/mods/report_feed.php' );

   }
}


?>
<!DOCYPE html>

<html>

<form action="" method="POST">

<b>Username:</b><input type="text" name="username" size="60" /><br />
<b>Password:</b><input type="password" name="password" size="60" /><br />

  <b>Are you human?</b><br />

  <?php echo $img; ?>

<br />
   <input type="submit" value="Login" />
      </form>

</html>

It keeps giving me this error: Parse error: syntax error, unexpected '}' in /home/a8913488/public_html/mods/index.php on line 54. I do not know how to fix this, and this is getting all my nerves because I don't know what is causing this error.

Line 52 you forgot ; at the end of the value: $ans = "Real Glo"; // Answer to image.

commented: Thanks! It really helped! +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.