tom527103 Posted June 19, 2011 Posted June 19, 2011 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/*****/public_html/5050.php on line 25 line 25 is ><a href="http://{$_SERVER[" target="_blank">Back</a>"; any help would be much appreciated thanks Quote
Uridium Posted June 19, 2011 Posted June 19, 2011 Read here >> http://stackoverflow.com/questions/5128474/php-serverserver-name-correct-use Quote
tom527103 Posted June 19, 2011 Author Posted June 19, 2011 hi hi thanks for that im semi sorted but now im getting Parse error: syntax error, unexpected '<' in /home/******/public_html/5050.php on line 46 could u tell me where im going wrong lol soo confused im a noob at php still learning <?php include "globals.php"; $_POST['bet'] =abs((int) $_POST['bet']); $_POST['type'] =abs((int) $_POST['type']); if($_POST['bet'] && $_POST['type']) { if($_POST['type'] == '1') { $type="crystals"; $limit=1000; $sym="/$"; $numty=number_format($_POST['bet']); } else { $type="money"; $limit=1000000; $sym=""; $numty=$_POST['bet']; } if($_POST['bet'] > $limit) { echo "Invalid Command. Your trying to bet over the limit. ><a href='/5050.php' target='_blank'>Back</a>; $h->endpage(); exit; } $chance=rand(1,2); if($chance == '1') { $blah=rand(10,20); $earn='{$type}/{$blah}'; $earnn=number_format($earn); echo '<font color=green size=1.2><b>You Won! You won {$sym}{$earnn} {$type} Congratulations.</b></font>'; $db->query('UPDATE users SET {$type}={$type}+{$earn} WHERE userid=$userid'); } else if($chance == '2') { echo '<font color=red size=1.2><b>You Lost! You lost {$sym}{$numty} {$type} bad luck.</b></font>'; $db->query('UPDATE users SET {$type}={$type}-{$_POST['bet']} WHERE userid=$userid'); } echo " ><a href='/5050.php' target='_blank'>Try Again</a>'; } else { echo " <form action='{$_SERVER['PHP_SELF']}' action='post'> How much would you like to bet? <input type='text' name='bet' value='0'> <span class="highlight">Crystals</span>: <input type='radio' name='type' value='1'> OR Money: <input type='radio' name='type' value='2'> <input type='submit' value='Bet!'> </form> "; } $h->endpage(); Quote
Uridium Posted June 19, 2011 Posted June 19, 2011 change lines 45-46 from echo " ><a href='/5050.php' target='_blank'>Try Again</a>'; to echo " ><a href='/5050.php' target='_blank'>Try Again</a>"; rememeber if an echo or a print statement opens with either " or ' they need to be closed with the same protocol... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.