.oO(Ken)
[color=blue]
>I am trying to read a JavaScript file.
>Permissions have been set to 755.
>
>Do I have to open the file first?[/color]
Yes.
[color=blue]
>$fileopen = fopen($filename, "rb");
>echo "File open = ".$fileopen; This echoes Resource id #4
> What is resource id #4?[/color]
fopen() returns an ID that denotes the currently opened file. It's a
handle for all further actions performed on that file.
[color=blue]
> Where do I find a definition of resource id #4?[/color]
Resource-IDs are a special type in PHP.
http://www.php.net/manual/en/languag...s.resource.php
[color=blue]
>$contents = fread($fileopen, filesize($fileopen));[/color]
You can't use filesize() on remote files in PHP4.
[color=blue]
>fclose($handle);[/color]
This should be
fclose($fileopen);
You could also try this simple code instead:
$filename = 'http://...';
$content = file_get_contents($filename);
http://www.php.net/file_get_contents
HTH
Micha