View Full Version : Undexpected $end error! Help me fix!

02-28-2009, 05:14 PM
<form method="post" action="<?php echo $PHP_SELF;?>">
<select name="server">
<option value="mafiacrime.org">Game 1</option>
<option value="game2.mafiacrime.org">Game 2</option>
<option value="fb.mafiacrime.org">Facebook</option></select><br />
ID#: <input type="text" size="12" maxlength="7" name="userid"><br />
Gang ID#: <input type="text" size="12" maxlength="7" name="gangid"><br />
<input type="submit" value="submit" name="submit"><br />
</form><br />

$id = $_POST["userid"];
$gid = $_POST["gangid"];
$game = $_POST["server"];
if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form

} else {
echo "

<br>http://mcstuff.co.uk/static/tl.png (http://".$server."/mailbox?to=".$id.")http://mcstuff.co.uk/static/tr.png (http://".$server."/send_money?id=".$id.")<br>
http://mcstuff.co.uk/static/tml.png (http://".$server."/attack?id=".$id.")http://mcstuff.co.uk/static/tmr.png (http://".$server."/profile?id=".$id."".$rate.")<br>
http://mcstuff.co.uk/static/tmbl.png (http://".$server."/add_contact?id=".$id.")http://mcstuff.co.uk/static/tmbr.png[/img] (http://".$server."/gang?id=".$gid."http://mcstuff.co.uk/static/bl.png (http://".$server."/send_points?id=".$id.")http://mcstuff.co.uk/static/br.png (http://mcstuff.co.uk)<br></font>

Gives me an error message:
Parse error: syntax error, unexpected $end in /home/n00b/public_html/generator.php on line 31

I see nothing wrong with it 0.0

02-28-2009, 05:17 PM
You never close your else statement.

02-28-2009, 07:08 PM
I would never have found that!

Thanks blud :)

02-28-2009, 07:16 PM
Yeah everytime you get $end you are missing a closing bracket }

02-28-2009, 08:50 PM
The error literally means that php reached the end of your file while it is still expecting php code. The most common reason is a missing }, but it can also be caused by a quoted string that is not closed. Any syntax that is started, but not closed. And, a missing } is not always due to an actual missing }. It can also be caused by a correct } that is contained within short open tags when short open tags are not enabled.