PDA

View Full Version : Need a lil bit of help to finish a very needed file!!!


wakawaka
03-19-2002, 05:11 PM
I know it is not really a hack, but i need "HELP!" on this

I used this script a minute ago:

<?

for($number = 10; $number <= 54; $number++)
{
$image = fopen ("http://www.arcticnightfall.com/berserk/pix/episode_01/image00$number.jpg", "r");

copy ($image, $image);
}

?>

and this is all it gave me:

Warning: fopen("http://www.arcticnightfall.com/berserk/pix/episode_01/image0010.jpg","r") - Unknown error in /home2/www/myurl/berserk/test/test.php on line 5

Warning: Unable to open '' for reading: No such file or directory in /home2/www/myurl/berserk/test/test.php on line 7

Warning: fopen("http://www.arcticnightfall.com/berserk/pix/episode_01/image0011.jpg","r") - Unknown error in /home2/www/myurl/berserk/test/test.php on line 5

Warning: Unable to open '' for reading: No such file or directory in /home2/www/myurl/berserk/test/test.php on line 7

first question is wHy did it not read the remote image, and 2nd question will it just keep writing over itself, or will my it actually save the images with their real names to my server?

Logician
03-20-2002, 11:20 AM
first replace line:
$image = fopen ("http://www.arcticnightfall.com/berserk/pix/episode_01/image00$number.jpg", "r");

with :

$image = fopen ("http://www.arcticnightfall.com/berserk/pix/episode_01/image0010.jpg", "r");

and see if you get rid of the error. If yes, try one of these:

$image = fopen ("http://www.arcticnightfall.com/berserk/pix/episode_01/image00{$number}.jpg", "r");

or

$testvar="http://www.arcticnightfall.com/berserk/pix/episode_01/image00".$number.".jpg";
$image = fopen ($testvar, "r");

if replacing line above didnt help the error message, double check your filenames (caps!) and their existence..

wakawaka
03-20-2002, 08:27 PM
still tells me:

Warning: Unable to open 'Resource id #1' for reading: No such file or directory in /home2/www/myurl/berserk/test/test.php on line 11

Warning: Unable to open 'Resource id #2' for reading: No such file or directory in /home2/www/myurl/berserk/test/test.php on line 11

Warning: Unable to open 'Resource id #3' for reading: No such file or directory in /home2/www/myurl/berserk/test/test.php on line 11

when i put in :
$testvar="http://www.arcticnightfall.com/berserk/pix/episode_01/image00".$number.".jpg";
$image = fopen ($testvar, "r");

I think my webhost just sux lol

Logician
03-20-2002, 08:38 PM
Does the line:
$image = fopen ("http://www.arcticnightfall.com/berserk/pix/episode_01/image0010.jpg", "r");

gives the error message too?

Your primary concern should be to discern if the error message is file name related or coding related.. if this line does not give you any error than it's coding related. But if this line still gives you the error then it is because of your server config/file names/file existence or file sharing properties..You have to figure that out first to debug it..