twiztedbluz Posted February 5, 2007 Share Posted February 5, 2007 I was working on this code before I left, and didn't save backup (stupid me) but when I had left, it was working. Now i've come back to my computer ,refreshed the page and it wasn't working at all. This error came up Parse error: syntax error, unexpected $end in /home/colin/public_html/hdt.php on line 155 I have no idea what the heck is going on :-\ This is my code <? include 'header.php'; $sql = mysql_query("SELECT upgrade, upgrade_expire, hdt FROM players WHERE playerID='$sid'"); $row = mysql_fetch_assoc($sql); //============If they want to exchange if ($_POST['submit']){ $want = $_POST['want']; //if they want an upgrade if ($want == 'upgrade'){ if ($row['hdt'] >= '20'){ if ($row['upgrade'] == 'no'){ $expire = date ('Y/m/d', strtotime ("$date + 1 year")); mysql_query("UPDATE players SET hdt=hdt-20, upgrade='yes', upgrade_expire='$expire' WHERE playerID='$sid'"); } else { $current = $row['upgrade_expire']; $new_expire = date ('Y/m/d', strtotime ("$current + 1 year")); mysql_query("UPDATE players SET hdt=hdt-20, upgrade_expire='$new_expire' WHERE playerID='$sid'"); } echo "<table class='main'><td class='main'>Successfully upgraded your account.</td></table>"; } else { echo "<table class='main'><td class='main'>You don't have enough tokens for this!</td></table>"; exit; } exit; } //if they want an upgrade if ($want == 'upgrade2'){ if ($row['hdt'] >= '10'){ if ($row['upgrade'] == 'no'){ $expire = date ('Y/m/d', strtotime ("$date + 6 month")); mysql_query("UPDATE players SET hdt=hdt-10, upgrade='yes', upgrade_expire='$expire' WHERE playerID='$sid'"); } else { $current = $row['upgrade_expire']; $new_expire = date ('Y/m/d', strtotime ("$current + 6 month")); mysql_query("UPDATE players SET hdt=hdt-10, upgrade_expire='$new_expire' WHERE playerID='$sid'"); } echo "<table class='main'><td class='main'>Successfully upgraded your account.</td></table>"; } else { exit; } exit; } //if they want money if ($want == 'money'){ if ($row['hdt'] >= '1'){ if ($row['upgrade'] == 'no'){ mysql_query("UPDATE players SET hdt=hdt-1, money=money+30000 WHERE playerID='$sid'"); } else { echo "<table class='main'><td class='main'>Successfully added money.</td></table>"; exit; } exit; } //=============Display page print <<<HERE <h3>Token Area</h3> This area is where you can exchange your HDT (Houndism Tokens) for game related things. <br>HDT's are what you get in return when you donate to Houndism. If you would like to donate <a href="donate.php">CLICK HERE.</a><p> <form action="hdt.php" method="post"> <table class='main' width="50%" align='center' cellpadding=4> <td class='main' align='center' colspan=2> You have <b><i>$row[hdt]</b></i> Tokens.<p> <select name="want"> <option value='upgrade'>1-Year Upgrade - 20 HDT</option> <option value='upgrade2'>6 Monthes Upgrade - 10 HDT</option> <option value='money'>30,000 HDD - 1 HDT</option> </select> <p> <input type="submit" name="submit" value="Exchange"> </td> </table> </form> <br><br><br> <u><b>Upgrade</b></u><p> If you upgrade for 10 HDT 20 HDT you will receive the following features:<p> <ul> <li>You will be able to wear a tag <li>You will be able to create 14 shows a day rather then just 7 <li>You will be able to enter each dog in 150 shows everyday instead of 75 <li>You may obtain a job such as being a vet or trainer. (Lots more jobs to come) <li>More money from the bank <li>Be able to create classes <li>Lots more being added </ul> HERE; include 'footer.php'; ?> Link to comment https://forums.phpfreaks.com/topic/37110-php-code-error-frusterated/ Share on other sites More sharing options...
JasonLewis Posted February 5, 2007 Share Posted February 5, 2007 by my count you still have 2 open braces. count them yourself, mayb i made a mistake. Link to comment https://forums.phpfreaks.com/topic/37110-php-code-error-frusterated/#findComment-177226 Share on other sites More sharing options...
hvle Posted February 5, 2007 Share Posted February 5, 2007 if you "tab" it well, these kind of errors should easily be spotted. Link to comment https://forums.phpfreaks.com/topic/37110-php-code-error-frusterated/#findComment-177228 Share on other sites More sharing options...
twiztedbluz Posted February 5, 2007 Author Share Posted February 5, 2007 thanks, i've closed my brackets, and fixed up my print<<<HERE part. The page loads now, but now my selections (6 monthes upgrade and 30,000 exchage) dont work, but my first option does, I have no idea why. Link to comment https://forums.phpfreaks.com/topic/37110-php-code-error-frusterated/#findComment-177247 Share on other sites More sharing options...
JasonLewis Posted February 6, 2007 Share Posted February 6, 2007 have you closed the braces in the right place? Link to comment https://forums.phpfreaks.com/topic/37110-php-code-error-frusterated/#findComment-177961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.