shashiku Posted July 25, 2007 Share Posted July 25, 2007 hi iam very new to php. i have installed wamp 5. iam having problems with the fopen() command. this simple script is giving an error. wamp uses PHP5 <?php $filename= "hello.txt" $handle = fopen($filename, "r"); ?> this is the error i get Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\web\new7.php on line 3 but the script works when i put the exact filename in the fopen() command like this <?php $handle = fopen("hello.txt", "r"); ?> this script works i dont know why the first script doesnt work.pls help me are there any differenes when using the fopen() in php5. pls help thankss Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 25, 2007 Share Posted July 25, 2007 can we see the real code hmm by the way whats this $filename= "hello.txt" no terminator Quote Link to comment Share on other sites More sharing options...
shashiku Posted July 25, 2007 Author Share Posted July 25, 2007 this is the actual code iam running. iam just cheking this simple code hello.txt is just a simple text file written by notepad. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 25, 2007 Share Posted July 25, 2007 so <?php $filename= "hello.txt" <-----------no terminator? $handle = fopen($filename, "r"); ?> look Quote Link to comment Share on other sites More sharing options...
shashiku Posted July 25, 2007 Author Share Posted July 25, 2007 thanks friend. i got the problem. iam very very new to php. thanks for helpinggggggggggggg byeeeeeeeeeee Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 25, 2007 Share Posted July 25, 2007 for every topic you post please mark it solved if it is Quote Link to comment Share on other sites More sharing options...
shashiku Posted July 25, 2007 Author Share Posted July 25, 2007 okkk thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.