$end unexpected - Can you 'spot' it? Short code

MerchantMilan

New Member
Problem with code - unexpected $end ? Tried for a good half an hour now to fix this problem....Can you spot the problem?\[code\]<?php session_start(); if (!isset($_SESSION['user_id'])) {if (isset($_COOKIE['user_id']) && isset($_COOKIE['username'])) { $_SESSION['user_id'] = $_COOKIE['user_id']; $_SESSION['username'] = $_COOKIE['username'];} }?><html><head></head><body>test<?php $dbc = mysqli_connect(localhost, hidden, hidden, hidden);if (!isset($_GET['shipID'])) { $query = "SELECT user_id, shipID, IP, Image FROM ships WHERE shipID = '" . $_SESSION['shipID'] . "'"; } else { $query = "SELECT user_id, shipID, IP, Image FROM ships WHERE shipID = '" . $_GET['shipID'] . "'"; } $data = http://stackoverflow.com/questions/12755194/mysqli_query($dbc, $query);while ($row = mysqli_fetch_array($data)) { if ($row['IP'] == $_SERVER["REMOTE_ADDR"]) { echo 'Cool'; }else { echo 'Fail' ; }?></body></html>\[/code\]The aim of the game is to testify that the IP address is the same as the one listed in the database.Any & all help appreciated.
 
Top