Current location: Hot Scripts Forums » Programming Languages » PHP » Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'{'' or `'$'' ..

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'{'' or `'$'' ..

Reply
  #1 (permalink)  
Old 06-21-09, 10:22 AM
Sheen Sheen is offline
New Member
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'{'' or `'$'' ..

I have been trying for a while now to try and get this PHP file working with my website, but this part I am completely confused on and I cannot find a fix as of yet. Here is the error:

PHP Code:
Parse errorparse errorexpecting `T_STRING' or `T_VARIABLE' or `'{'' or `'$'' in C:\xampp\htdocs\web\panel.php on line 45 
On this line stands:

PHP Code:
$port $data->80
And I am almost certain that the port is correct.

Can Anyone help me out?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-21-09, 10:40 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,535
Thanks: 5
Thanked 17 Times in 16 Posts
A variable name should follow after the arrow. And since variable names cannot begin with numbers, you're getting a parse error. Are you sure it's not something like this?
PHP Code:
$port $data->port
...?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-21-09, 02:58 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 2,832
Thanks: 13
Thanked 10 Times in 9 Posts
Quote:
Originally Posted by Nico View Post
A variable name should follow after the arrow. And since variable names cannot begin with numbers, you're getting a parse error. Are you sure it's not something like this?
PHP Code:
$port $data->port
Or possibly:
PHP Code:
$port $data->'80'
[/QUOTE]
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data (scroll down)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-21-09, 08:05 PM
=OTS=G-Man =OTS=G-Man is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by End User View Post
Or possibly:
PHP Code:
$port $data->'80'
[/QUOTE]

well doing that is, well pointless.

cause if your using a static number then you might as well just do

$port = 80;

but because he is getting the data from a object then you would need

$port = $data->port;

or what ever the name of the variable for where the port is stored in is called.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share 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


All times are GMT -5. The time now is 08:02 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.