vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Errror number 2 (https://vborg.vbsupport.ru/showthread.php?t=61264)

gengar003 02-07-2004 01:33 AM

Errror number 2
 
I'm using this code to open a remote file and display its contents.

PHP Code:

<?
$filename = "http://tacorner.com/news/tanewsupdate.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd,filesize ($filename));//// The thing it doesn't like

fclose ($fd); 
$delimiter = ",";
$splitcontents = explode($delimiter, $contents);
$counter = "";

echo $contents;

foreach ( $splitcontents as $color )
{

$counter = $counter+1;
echo "<b>Split $counter: </b> $color\n<br>";
}

?>

And the file *does* exist.

Now, when I run the script, I get the following error:


Warning: filesize(): Stat failed for http://tacorner.com/news/tanewsupdate.txt (errno=2 - No such file or directory) in /home/tacorne/public_html/news/testing.php on line 6


Any idea why?

Xenon 02-07-2004 10:31 PM

have you set up the chmod correctly for that file?
it must be readable to php, so readable to the world ;)

gengar003 02-08-2004 02:16 PM

I CHMOD it 777 and still get the error.

Xenon 02-08-2004 10:17 PM

try to chmod the directory as well.

also some servers are preventing crossfile opening between different servers..


All times are GMT. The time now is 03:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01472 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete