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 Link to comment https://forums.phpfreaks.com/topic/61656-solved-help-needed-fopen-not-working/ 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 Link to comment https://forums.phpfreaks.com/topic/61656-solved-help-needed-fopen-not-working/#findComment-306901 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. Link to comment https://forums.phpfreaks.com/topic/61656-solved-help-needed-fopen-not-working/#findComment-306906 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 Link to comment https://forums.phpfreaks.com/topic/61656-solved-help-needed-fopen-not-working/#findComment-306911 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 Link to comment https://forums.phpfreaks.com/topic/61656-solved-help-needed-fopen-not-working/#findComment-306912 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 Link to comment https://forums.phpfreaks.com/topic/61656-solved-help-needed-fopen-not-working/#findComment-306913 Share on other sites More sharing options...
shashiku Posted July 25, 2007 Author Share Posted July 25, 2007 okkk thanks again Link to comment https://forums.phpfreaks.com/topic/61656-solved-help-needed-fopen-not-working/#findComment-306923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.