homepage Welcome to WebmasterWorld Guest from 54.166.108.167
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
t variable error
rlansi




msg:3415805
 1:56 pm on Aug 7, 2007 (gmt 0)

I am trying to use the following code to wirte a page contents to a file. I however get the error:

Parse error: parse error, unexpected T_VARIABLE ....on line 2.

code-------------------
<?php
$str$fh = fopen("http://blabla.com/bla.htm","r");
$fo = fopen("test1.txt","w");
while(!feof($fh)){fwrite($fo,fread($fh,1024));}
?>
-----------------------

Could you please help with this error?

 

d40sithui




msg:3415810
 2:03 pm on Aug 7, 2007 (gmt 0)


change the first line to this
$fh = fopen("http://blabla.com/bla.htm","r");

coho75




msg:3415812
 2:04 pm on Aug 7, 2007 (gmt 0)

I'm guessing the error refers to this '$str$fh.' It looks like you have two variables put together.

dreamcatcher




msg:3415813
 2:04 pm on Aug 7, 2007 (gmt 0)

Hi rlansi, welcome to Webmaster World. :)

I`m guessing this is your problem:

$str$fh

What is that exactly?

dc

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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved