Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    96
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Undexpected $end error! Help me fix!

    PHP Code:
    <html>
    <head>
    <title>Generator</title>
    </head>
    <body>
    <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 />
    </body>
    </html>

    <?php
    $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 
    "
    [center]<br>[url=http://"
    .$server."/mailbox?to=".$id."][img]http://mcstuff.co.uk/static/tl.png[/img][/url][url=http://".$server."/send_money?id=".$id."][img]http://mcstuff.co.uk/static/tr.png[/img][/url]<br>
    [url=http://"
    .$server."/attack?id=".$id."][img]http://mcstuff.co.uk/static/tml.png[/img][/url][url=http://".$server."/profile?id=".$id."".$rate."][img]http://mcstuff.co.uk/static/tmr.png[/img][/url]<br>
    [url=http://"
    .$server."/add_contact?id=".$id."][img]http://mcstuff.co.uk/static/tmbl.png[/img][/url][url=http://".$server."/gang?id=".$gid."[img]http://mcstuff.co.uk/static/tmbr.png[/img][/url]<br>
    [url=http://"
    .$server."/send_points?id=".$id."][img]http://mcstuff.co.uk/static/bl.png[/img][/url][url=http://mcstuff.co.uk][img]http://mcstuff.co.uk/static/br.png[/img][/url]<br>[/center]</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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You never close your else statement.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Jul 2008
    Posts
    96
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I would never have found that!

    Thanks blud

  • #4
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Yeah everytime you get $end you are missing a closing bracket }

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,092
    Thanks
    2
    Thanked 322 Times in 314 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •