mrjamin
06-08-2003, 09:41 PM
Ok, here's the deal.
I have a blog that's hosted remotely. I thought it'd be cool to have my webcam displaying on the blog too. I didn't want to upload an image every x seconds as it'd eat my bandwidth and slow down my pc, so i found an app that takes a shot from the webcam and saves it to my harddisk. I've set it to save in my local server directory (i run php/apache locally). I thne thought it'd be pretty smart to get some info from the image, like the date/time it was taken for when my webcam's running. I'm using PHP's stat() function, which (obviously) you can only use on local files, so i'd have to get this info in a local php script.
Here's the problem:
<?
if(@file("http://benlancaster.mine.nu/webcam.php")){
include("http://benlancaster.mine.nu/webcam.php");
}else{
print("<p align=center>Webcam is <font color=red><strong>offline</strong></font></p>\n");
}
?>
when i use the above code to include the php file which is saved locally in my server directory, it includes everything it should with no problem, BUT it prints the following nasty error:
Warning: main(): stream does not support seeking in /home/benlanca/public_html/index.php on line 86
...where line 86 is:
include("http://benlancaster.mine.nu/webcam.php");
anybody know why this is and how i can solve it? I've read through http://www.php.net/manual/en/features.remote-files.php and http://www.php.net/manual/en/function.include.php but neither seemed to help. Any ideas?
Thanks in advace,
MrJ
edit: i'm running 4.1.2 locally (thats irrlevant though) and the server's running 4.3.2, which according to php.net can cope with remote files through includes.
I have a blog that's hosted remotely. I thought it'd be cool to have my webcam displaying on the blog too. I didn't want to upload an image every x seconds as it'd eat my bandwidth and slow down my pc, so i found an app that takes a shot from the webcam and saves it to my harddisk. I've set it to save in my local server directory (i run php/apache locally). I thne thought it'd be pretty smart to get some info from the image, like the date/time it was taken for when my webcam's running. I'm using PHP's stat() function, which (obviously) you can only use on local files, so i'd have to get this info in a local php script.
Here's the problem:
<?
if(@file("http://benlancaster.mine.nu/webcam.php")){
include("http://benlancaster.mine.nu/webcam.php");
}else{
print("<p align=center>Webcam is <font color=red><strong>offline</strong></font></p>\n");
}
?>
when i use the above code to include the php file which is saved locally in my server directory, it includes everything it should with no problem, BUT it prints the following nasty error:
Warning: main(): stream does not support seeking in /home/benlanca/public_html/index.php on line 86
...where line 86 is:
include("http://benlancaster.mine.nu/webcam.php");
anybody know why this is and how i can solve it? I've read through http://www.php.net/manual/en/features.remote-files.php and http://www.php.net/manual/en/function.include.php but neither seemed to help. Any ideas?
Thanks in advace,
MrJ
edit: i'm running 4.1.2 locally (thats irrlevant though) and the server's running 4.3.2, which according to php.net can cope with remote files through includes.