Jump to content
xisto Community
Sign in to follow this  
Sinari

Award Script Help?

Recommended Posts

I have an game/reward script that is written, but I can't get it to work. Can someone take a look at it and tell me what's wrong?I'm getting: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/unspoke/public_html/darkfutures/slots.php on line 32I attached the file below for you guys to take a look at. I'll be around.

slots.php

Share this post


Link to post
Share on other sites

Alright, i think i see your problem. From looking at the code, it looks like you are checking to see if the three variables match and if they do then you want to execute some more code to do that, right? Well, the way you are doing it is through the echo command to execute the code if i'm correct. The problem is, that when you execute the code using the echo command, you used " for everything, including the code you were trying to execute, so when you reached another ", it would bring up an error. I think a better way to do that, would be to cut out the echo statements and just do it normally (like in C++). Now, when I do this, I get more errors and am not sure if that's from not having all of your files (include statements) or if they are other errors, I beleive they are other variable errors; however, since I really am not the best at PHP, I'll leave it up to someone else to figure out.I have attached the code I have modified for you to view.

slots.php

Share this post


Link to post
Share on other sites

Oops! Here's the other file that it calls to. It calls for a header and footer, but they aren't the problem.... I know it's the one section that's having issues since I get an error when it's coded:

<?phpif ($one==$two) {   if ($two==$three) {   echo " <?php echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";?> ">\n";      if ($one=="images/slots/04.GIF") {      echo " <?php echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";?>  ">\n";      }   }}?>

But when it's coded like this:

<?phpif ($one==$two) {   if ($two==$three) {   echo " <?php include('rand-cards.php')?> \n";      if ($one=="images/slots/04.GIF") {      echo " <?php include('rand-cards.php')?>  \n";      }   }}?>

It works and nothing shows up... That include is to a randomizer script, and it works on every other page it's used on. Any further ideas? I'm trying to give you the best info I can.

reward.php

Share this post


Link to post
Share on other sites

I'm afraid I can't help anymore, I've only tapped PHP so i was looking at it from a C++ perspective. I wish you luck on finding the problem though.

Share this post


Link to post
Share on other sites

THe problem i see is your trying to echo php code and expect it to work

 

<?php

 

if ($one==$two) {

if ($two==$three) {

echo " <?php

 

From what i understand when you load a page all the php code has already been executed. so echoing another echo of <?php

 ?> wont work. It would just get ouputed as plain text "<?php .....". 

 

So you will have to change your code so that it does not contain <?php tags inside a <?php tag

 

<?php

 

if ($one==$two) {

if ($two==$three) {

echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";

echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";

echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";

 

if ($one=="images/slots/04.GIF") {

echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";

echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";

echo "<img src=" . $special[array_rand($special,1)] . $digits2[array_rand($digits2,1)] . ">\n";

}

}

}

 

?>

 

let me know if it works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.