Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Award Script Help?
Sinari
post Jul 9 2007, 06:54 PM
Post #1


Premium Member
********

Group: Members
Posts: 168
Joined: 21-March 06
From: Somewhere...
Member No.: 20,464



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 32

I attached the file below for you guys to take a look at. I'll be around.
Attached File(s)
Attached File  slots.php ( 1.72k ) Number of downloads: 5
 
Go to the top of the page
 
+Quote Post
t3jem
post Jul 9 2007, 07:31 PM
Post #2


Privileged Member
*********

Group: [HOSTED]
Posts: 519
Joined: 9-February 07
Member No.: 38,519



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.
Attached File(s)
Attached File  slots.php ( 1.7k ) Number of downloads: 1
 
Go to the top of the page
 
+Quote Post
Sinari
post Jul 9 2007, 07:48 PM
Post #3


Premium Member
********

Group: Members
Posts: 168
Joined: 21-March 06
From: Somewhere...
Member No.: 20,464



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:

CODE
<?php

if ($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:

CODE
<?php

if ($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.
Attached File(s)
Attached File  reward.php ( 354bytes ) Number of downloads: 1
 
Go to the top of the page
 
+Quote Post
t3jem
post Jul 10 2007, 02:58 PM
Post #4


Privileged Member
*********

Group: [HOSTED]
Posts: 519
Joined: 9-February 07
Member No.: 38,519



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.
Go to the top of the page
 
+Quote Post
sonesay
post Jul 12 2007, 07:43 AM
Post #5


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 688
Joined: 20-June 07
From: Auckland
Member No.: 45,102



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 [code] ?> 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Many Php Script Sites(16)
  2. Script: Php Jukebox(4)
  3. Parse: Error Unexpected T_lnumber(4)
  4. Transfer Variables To Another Php Script(8)
  5. Watermark Your Image With Simple Php Script(35)
  6. Script That Tracks The User Status(4)
  7. Wappychat_oldskool(15)
  8. Free Auction Script(6)
  9. Wappy Buddy V1.10 - Tibia Gold Edition By Wappy & Jon Roig(3)
  10. What Kind Of Script Do You Need ?(15)
  11. Creatting A Playlist Through Php(5)
  12. Very Simple Online Now Script(4)
  13. Html Code Tester. Online Script(15)
  14. Will This Code Work(5)
  15. Php Downloads Script(4)
  1. Script Help Required: Undefined Variable(3)
  2. Script Not Working(6)
  3. Library Script(6)
  4. How Would I Go About Making A Simple "counting" Script?(3)
  5. Forum Script(3)
  6. Php Rediret Script(12)
  7. Download Script For Mp3 Files(0)
  8. How Do I Connect To Live Database With Php Script?(6)
  9. Need Help Installing Dolphin Community Script!(5)
  10. Guessing Php Script(2)
  11. How To Make A View New Post Script?(5)
  12. Php Guest Online Script(3)
  13. How To Make Php Newsletter Script(3)


 



- Lo-Fi Version Time is now: 12th October 2008 - 11:26 AM