tbare Posted November 21, 2007 Share Posted November 21, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/78242-solved-filesize-problems/ Share on other sites More sharing options...
tbare Posted November 21, 2007 Author Share Posted November 21, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/78242-solved-filesize-problems/#findComment-395967 Share on other sites More sharing options...
trq Posted November 21, 2007 Share Posted November 21, 2007 Variables are not interpolated within single quotes. $size = filesize("files/video/$file"); Quote Link to comment https://forums.phpfreaks.com/topic/78242-solved-filesize-problems/#findComment-395972 Share on other sites More sharing options...
tbare Posted November 21, 2007 Author Share Posted November 21, 2007 yeah.. just figured it out... thanks! $size = filesize('files/video/' . $file); Quote Link to comment https://forums.phpfreaks.com/topic/78242-solved-filesize-problems/#findComment-395976 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.