Jump to content

PHP Code error [frusterated]


twiztedbluz

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.