Jump to content
MakeWebGames

Recommended Posts

Posted

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();
Posted

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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...