Jump to content

[SOLVED] filesize() problems


tbare

Recommended Posts

here's the url:

example.com/humor_video_play.php?file=CircleCircleDotDot.avi

 

here's the code:

$file = $_GET['file'];
$size = filesize('files/video/$file');
print "$size";

 

here's the error:

Warning: filesize() [function.filesize]: stat failed for files/video/$file in /home/tbare/wannafork/humor_video_play.php on line 37

 

any ideas?

Link to comment
https://forums.phpfreaks.com/topic/78242-solved-filesize-problems/
Share on other sites

UPDATE:

 

if i manually specify the file name like so:

$size = filesize('files/video/CircleCircleDotDot.avi');

 

it works, but not if i pull the file name from $file like so:

$size = filesize('files/video/$file');

 

why doesn't that work?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.