slipknot Posted October 20, 2008 Share Posted October 20, 2008 <?php include "globals.php"; if(!$_GET['spend']) { print "Welcome to the crystal temple! You have [b]{$ir['crystals']}[/b] crystals. What would you like to spend your crystals on? [url='crystaltemple.php?spend=refill']Energy Refill - {$set['ct_refillprice']} Crystals[/url] [url='crystaltemple.php?spend=IQ']IQ - {$set['ct_iqpercrys']} IQ per crystal[/url] [url='crystaltemple.php?spend=money']Money - \$".number_format($set['ct_moneypercrys'])." per crystal[/url] " [url='crystaltemple.php?spend=will']Will Refill - 50 Crystals[/url] " [url='crystaltemple.php?spend=brave']Brave Refill - 50 Crystals[/url] ; } else { if($_GET['spend'] == 'refill') { if($ir['crystals'] <$set['ct_refillprice']) { print "You don't have enough crystals!"; } else if($ir['energy'] == $ir['maxenergy']) { print "You already have full energy."; } else { $db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid"); print "You have paid {$set['ct_refillprice']} crystals to refill your energy bar."; if($_GET['spend'] == 'will') { if($ir['crystals'] < 100) { print "You don't have enough crystals!"; } else if($ir['will'] == $ir['maxwill']) { print "You already have full will."; } else { $db->query("UPDATE users SET will=maxwill,crystals=crystals-100 WHERE userid=$userid"); print "You have paid 100 crystals to refill your will bar."; } } } } else if($_GET['spend'] == 'IQ') { print "Type in the amount of crystals you want to swap for IQ. You have [b]{$ir['crystals']}[/b] crystals. One crystal = {$set['ct_iqpercrys']} IQ.<form action='crystaltemple.php?spend=IQ2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'IQ2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=IQ']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_iqpercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid"); $db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for $iqgain IQ."; } } else if($_GET['spend'] == 'money') { print "Type in the amount of crystals you want to swap for money. You have [b]{$ir['crystals']}[/b] crystals. One crystal = \$".number_format($set['ct_moneypercrys']).".<form action='crystaltemple.php?spend=money2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'money2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=money']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_moneypercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']},money=money+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for \$".number_format($iqgain)."."; } } } $h->endpage(); ?> it comes up with Parse error: syntax error, unexpected T_STRING in /home/scatter1/public_html/crystaltemple.php on line 12 Added code tags -- Tezza` Quote Link to comment Share on other sites More sharing options...
Arkvoodle` Posted October 20, 2008 Share Posted October 20, 2008 Re: help me plz <?php include "globals.php"; if(!$_GET['spend']) { print "Welcome to the crystal temple! You have [b]{$ir['crystals']}[/b] crystals. What would you like to spend your crystals on? [url='crystaltemple.php?spend=refill']Energy Refill - {$set['ct_refillprice']} Crystals[/url] [url='crystaltemple.php?spend=IQ']IQ - {$set['ct_iqpercrys']} IQ per crystal[/url] [url='crystaltemple.php?spend=money']Money - \$'.number_format($set['ct_moneypercrys']).' per crystal[/url] [url='crystaltemple.php?spend=will']Will Refill - 50 Crystals[/url] [url='crystaltemple.php?spend=brave']Brave Refill - 50 Crystals[/url] "; } else { if($_GET['spend'] == 'refill') { if($ir['crystals'] <$set['ct_refillprice']) { print "You don't have enough crystals!"; } else if($ir['energy'] == $ir['maxenergy']) { print "You already have full energy."; } else { $db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid"); print "You have paid {$set['ct_refillprice']} crystals to refill your energy bar."; if($_GET['spend'] == 'will') { if($ir['crystals'] < 100) { print "You don't have enough crystals!"; } else if($ir['will'] == $ir['maxwill']) { print "You already have full will."; } else { $db->query("UPDATE users SET will=maxwill,crystals=crystals-100 WHERE userid=$userid"); print "You have paid 100 crystals to refill your will bar."; } } } } else if($_GET['spend'] == 'IQ') { print "Type in the amount of crystals you want to swap for IQ. You have [b]{$ir['crystals']}[/b] crystals. One crystal = {$set['ct_iqpercrys']} IQ.<form action='crystaltemple.php?spend=IQ2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'IQ2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=IQ']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_iqpercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid"); $db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for $iqgain IQ."; } } else if($_GET['spend'] == 'money') { print "Type in the amount of crystals you want to swap for money. You have [b]{$ir['crystals']}[/b] crystals. One crystal = \$".number_format($set['ct_moneypercrys']).".<form action='crystaltemple.php?spend=money2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'money2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=money']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_moneypercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']},money=money+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for \$".number_format($iqgain)."."; } } } $h->endpage(); ?> There you go. Didn't look through the rest though... Quote Link to comment Share on other sites More sharing options...
slipknot Posted October 20, 2008 Author Share Posted October 20, 2008 Re: help me plz I am getting Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/scatter1/public_html/crystaltemple.php on line 11 Quote Link to comment Share on other sites More sharing options...
Arkvoodle` Posted October 20, 2008 Share Posted October 20, 2008 Re: help me plz <?php include "globals.php"; if(!$_GET['spend']) { print "Welcome to the crystal temple! You have [b]{$ir['crystals']}[/b] crystals. What would you like to spend your crystals on? [url='crystaltemple.php?spend=refill']Energy Refill - {$set['ct_refillprice']} Crystals[/url] [url='crystaltemple.php?spend=IQ']IQ - {$set['ct_iqpercrys']} IQ per crystal[/url] [url='crystaltemple.php?spend=money']Money - \$($set['ct_moneypercrys']) per crystal[/url] [url='crystaltemple.php?spend=will']Will Refill - 50 Crystals[/url] [url='crystaltemple.php?spend=brave']Brave Refill - 50 Crystals[/url] "; } else { if($_GET['spend'] == 'refill') { if($ir['crystals'] <$set['ct_refillprice']) { print "You don't have enough crystals!"; } else if($ir['energy'] == $ir['maxenergy']) { print "You already have full energy."; } else { $db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid"); print "You have paid {$set['ct_refillprice']} crystals to refill your energy bar."; if($_GET['spend'] == 'will') { if($ir['crystals'] < 100) { print "You don't have enough crystals!"; } else if($ir['will'] == $ir['maxwill']) { print "You already have full will."; } else { $db->query("UPDATE users SET will=maxwill,crystals=crystals-100 WHERE userid=$userid"); print "You have paid 100 crystals to refill your will bar."; } } } } else if($_GET['spend'] == 'IQ') { print "Type in the amount of crystals you want to swap for IQ. You have [b]{$ir['crystals']}[/b] crystals. One crystal = {$set['ct_iqpercrys']} IQ.<form action='crystaltemple.php?spend=IQ2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'IQ2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=IQ']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_iqpercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid"); $db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for $iqgain IQ."; } } else if($_GET['spend'] == 'money') { print "Type in the amount of crystals you want to swap for money. You have [b]{$ir['crystals']}[/b] crystals. One crystal = \$".number_format($set['ct_moneypercrys']).".<form action='crystaltemple.php?spend=money2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'money2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=money']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_moneypercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']},money=money+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for \$".number_format($iqgain)."."; } } } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
slipknot Posted October 20, 2008 Author Share Posted October 20, 2008 Re: help me plz getting the same problem Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/scatter1/public_html/crystaltemple.php on line 11 Quote Link to comment Share on other sites More sharing options...
War_Hero Posted October 20, 2008 Share Posted October 20, 2008 Re: help me plz Try this: <?php include "globals.php"; if(!$_GET['spend']) { print "Welcome to the crystal temple! You have [b]{$ir['crystals']}[/b] crystals. What would you like to spend your crystals on? [url='crystaltemple.php?spend=refill']Energy Refill - {$set['ct_refillprice']} Crystals[/url] [url='crystaltemple.php?spend=IQ']IQ - {$set['ct_iqpercrys']} IQ per crystal[/url] [url='crystaltemple.php?spend=money']Money - \${$set['ct_moneypercrys']} per crystal[/url] [url='crystaltemple.php?spend=will']Will Refill - 50 Crystals[/url] [url='crystaltemple.php?spend=brave']Brave Refill - 50 Crystals[/url] "; } else { if($_GET['spend'] == 'refill') { if($ir['crystals'] <$set['ct_refillprice']) { print "You don't have enough crystals!"; } else if($ir['energy'] == $ir['maxenergy']) { print "You already have full energy."; } else { $db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid"); print "You have paid {$set['ct_refillprice']} crystals to refill your energy bar."; if($_GET['spend'] == 'will') { if($ir['crystals'] < 100) { print "You don't have enough crystals!"; } else if($ir['will'] == $ir['maxwill']) { print "You already have full will."; } else { $db->query("UPDATE users SET will=maxwill,crystals=crystals-100 WHERE userid=$userid"); print "You have paid 100 crystals to refill your will bar."; } } } } else if($_GET['spend'] == 'IQ') { print "Type in the amount of crystals you want to swap for IQ. You have [b]{$ir['crystals']}[/b] crystals. One crystal = {$set['ct_iqpercrys']} IQ.<form action='crystaltemple.php?spend=IQ2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'IQ2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=IQ']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_iqpercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid"); $db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for $iqgain IQ."; } } else if($_GET['spend'] == 'money') { print "Type in the amount of crystals you want to swap for money. You have [b]{$ir['crystals']}[/b] crystals. One crystal = \$".number_format($set['ct_moneypercrys']).".<form action='crystaltemple.php?spend=money2' method='post'><input type='text' name='crystals' /> <input type='submit' value='Swap' /></form>"; } else if($_GET['spend'] == 'money2') { $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form. [url='crystaltemple.php?spend=money']Back[/url]"; } else { $iqgain=$_POST['crystals']*$set['ct_moneypercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']},money=money+$iqgain WHERE userid=$userid"); print "You traded {$_POST['crystals']} crystals for \$".number_format($iqgain)."."; } } } $h->endpage(); ?> I haven't looked through all of it yet. Quote Link to comment Share on other sites More sharing options...
slipknot Posted October 20, 2008 Author Share Posted October 20, 2008 Re: help me plz thanks War hero it works i just need to write a thing for it now thanks m8 I am in desperate need of a coder Quote Link to comment Share on other sites More sharing options...
War_Hero Posted October 20, 2008 Share Posted October 20, 2008 Re: help me plz No probs. :) Glad I could help. Quote Link to comment Share on other sites More sharing options...
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.