homepage Welcome to WebmasterWorld Guest from 54.196.24.103
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
parse error, unexpected T_VARIABLE in ...
unexpected parse error
rbailets




msg:1281951
 2:08 pm on Sep 1, 2002 (gmt 0)

I am getting what seems to be a very unusual error which I belive may have something to do with my installation of php (its a new intallation). This is the simplified senerio.

I have a file which includes another file:

<? php include('file_2.php'); ?>

-----
file 2 can contain a statement as simple as:

<?php $testVar = "this is a test";?>
-----
and I get this error:

Parse error: parse error, unexpected T_VARIABLE in file_2.php on line 1

 

Nick_W




msg:1281952
 2:16 pm on Sep 1, 2002 (gmt 0)

Welcome to WebmasterWorld rbailets

Post the whole code. this error is usually because you have a curly brace or something missing...

Nick

rbailets




msg:1281953
 2:59 pm on Sep 1, 2002 (gmt 0)

Nick,

Thank you, for responding. It was a stupid error on my part. The error turned out to be a space between "<?" and "php"

Ralph

dhdweb




msg:1281954
 3:40 pm on Sep 1, 2002 (gmt 0)

I was going to say that .... lol

Nick_W




msg:1281955
 3:54 pm on Sep 1, 2002 (gmt 0)

Yeah, I've been programming php for a long time and I still make errors like that. You just need to really scrutinize your syntax before thinking somethings wrong ;) I do it all the time!

Nick

andreasfriedrich




msg:1281956
 11:52 pm on Sep 2, 2002 (gmt 0)

Having an editor with syntax highlighting helps a great deal to avoid errors like that. Whenever the color doesn´t change the way you expect it to, there is some (stupid) mistake.

The automatic indenting feature of many editors helps, too. I use it to spot errors in php, perl, css, html code.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved