finding page size

Reply

Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

finding page size

 
0
  #1
May 8th, 2006
<?$file="www.mysite.com";

$fh=fopen($file, "r");
$fileinfo=fstat($fh);
$b=filesize("$file");
print $b;
echo "Filename:" .basename($file)."<br/>";
echo "Filesize: ".round(($fileinfo["size"]/1024),2)."kb <br/>";?>

this is the code to determine the size of the page. but i m getting the error as filesize() [function.filesize]: stat failed for www.mysite.com
any body help in finding the page size of teh given url
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1
Reputation: Marky is an unknown quantity at this point 
Solved Threads: 0
Marky Marky is offline Offline
Newbie Poster

Re: finding page size

 
0
  #2
May 9th, 2006
You can't use fstat on a remote file.

You want to use a function like: http://www.php-editors.com/contest/1/33-read.html

Good luck!
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

Re: finding page size

 
0
  #3
May 10th, 2006
thanks u so much
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC