Current location: Hot Scripts Forums » Programming Languages » PHP » Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' HELP


Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' HELP

Reply
  #1 (permalink)  
Old 06-27-06, 12:29 AM
stormshadow's Avatar
stormshadow stormshadow is offline
Coding Addict
 
Join Date: Mar 2005
Posts: 355
Thanks: 0
Thanked 0 Times in 0 Posts
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' HELP

Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/loston/public_html/slots.php on line 97

Okay... Im not really sure on what the error is saying... from what i get out of it that on line 97 there is an integer that needs to be a variable... ? im not too sure welll here is line 97 and surroundings...

PHP Code:

if($playerinfo[bonus_slots]=='Y'){ 

                
mysql_query("UPDATE member SET bonus_slots='N' WHERE id='$playerinfo[id]'"); 
                }
                
// set random variables
                
$rand(1,6); // ~+~+LINE 97~+~+
                
$rand(1,6);
                $
rand(1,6);
                if($
1==1){ $img1 "orange.gif"$num1 2; }elseif($1==2){ $img1 "lemon.gif"$num1 3;}elseif($1==3){ $img1 "cherry.gif"$num1 1; }elseif($1==4){ $img1 "lemon.gif"$num1 3; }elseif($1==5){ $img1 "orange.gif"$num1 2;}elseif($1==6){ $img1 "lemon.gif"$num1 3; }
                if($
2==1){ $img2 "orange.gif"$num2 2; }elseif($2==2){ $img2 "lemon.gif"$num2 3;}elseif($2==3){ $img2 "cherry.gif"$num2 1; }elseif($2==4){ $img2 "lemon.gif"$num2 3; }elseif($2==5){ $img2 "orange.gif"$num2 2;}elseif($2==6){ $img2 "lemon.gif"$num2 3; }
                if($
3==1){ $img3 "orange.gif"$num3 2; }elseif($3==2){ $img3 "lemon.gif"$num3 3;}elseif($3==3){ $img3 "cherry.gif"$num3 1; }elseif($3==4){ $img3 "lemon.gif"$num3 3; }elseif($3==5){ $img3 "orange.gif"$num3 2;}elseif($3==6){ $img3 "lemon.gif"$num3 3; }
                echo
"<img src=images/$img1><img src=images/$img2><img src=images/$img3><br>";
                if(
$num1 == $num2 && $num2 == $num3){
                    
//win
                    
if($num1 == 1){ $int 500$fruit "cherries"mysql_query("UPDATE member SET bonus_slots='Y' WHERE id='$playerinfo[id]'");}elseif($num1==2){ $int 250$fruit "oranges"; }else{ $int 100$fruit "lemons";}
                    if(
$bet>8500){ $winnings = ($bet 3) + $int
                    }elseif(
$bet>4000 && $bet <8501){ $winnings = ($bet 2) + $int
                    }else{ 
$winnings $bet $int
                    }
//winnings
                    
$new_wallet = (($playerinfo[wallet]-$bet)+$winnings;
                    
mysql_query("UPDATE member SET wallet='$new_wallet' WHERE id='$playerinfo[id]'");
                    
$winnings number_format($winnings,2);
                    echo
"You got 3 $fruit! You won $$winnings!<br>";
                    if(
$num1==1){ echo"<b><a href=slots.php?step=bonus>BONUS GAME</a></b><br>"; }
                    echo
"<a href=slots.php?step=play&bet=$bet>Play Again at the same bet?</a><br>
                    <a href=slots.php>Change Bets</a><br>
                    <a href=casino.php>Back to Casino</a><br>
                    <a href=city.php>Go Back into Town</a><br>"
;
                    
                }else{
                    
//lose
                    
echo"BOO! Too bad you lose. It's not too hard to win! Now do it right!<br>
                    <a href=slots.php?step=play&bet=
$bet>Play Again at the same bet?</a><br>
                    <a href=slots.php>Change Bets</a><br>
                    <a href=casino.php>Back to Casino</a><br>
                    <a href=city.php>Go Back into Town</a><br>"
;
                } 
(I'm trying to make a custom slot machine...)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-27-06, 02:35 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Variables cannot begin with integers, only letters and underscores.

My suggestion: use $_1 or $one as opposed to $1, and so on...
__________________
The toxic ZCE

Last edited by Keith; 06-27-06 at 02:40 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-27-06, 10:27 AM
stormshadow's Avatar
stormshadow stormshadow is offline
Coding Addict
 
Join Date: Mar 2005
Posts: 355
Thanks: 0
Thanked 0 Times in 0 Posts
darn

alright thanks...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRIN aprogrammer PHP 20 08-31-11 06:56 AM


All times are GMT -5. The time now is 11:07 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.