Reading a text file from another server, Reading a simple text file from another website |
Reading a text file from another server, Reading a simple text file from another website |
TheHeist |
Jan 10 2011, 11:37 AM
Post
#1
|
Member Group: Members Posts: 32 Joined: 1-September 10 Member No.: 12,636 |
Hi, I am trying to make it so that when anyone uses my code it automatically loads news from a file on my site. I can do it locally but can't get it to load using url. Any suggestions? And can I name the file: news.data instead of news.txt or will that screw it up?
Thanks, The Heist This doesn't work: CODE $myFile = "http://www.enochwright.com/news.txt"; $fh = fopen($myFile, 'r'); $theNews = fread($fh, filesize($myFile)); fclose($fh); |
TheHeist |
Jan 10 2011, 12:20 PM
Post
#2
|
Member Group: Members Posts: 32 Joined: 1-September 10 Member No.: 12,636 |
CODE Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /homepages/43/d318702296/htdocs/ew/cms/index.php on line 7 Warning: fopen(http://www.enochwright.com/cms/news.txt) [function.fopen]: failed to open stream: no suitable wrapper could be found in /homepages/43/d318702296/htdocs/ew/cms/index.php on line 7 Warning: filesize() [function.filesize]: stat failed for http://www.enochwright.com/cms/news.txt in /homepages/43/d318702296/htdocs/ew/cms/index.php on line 8 Warning: fread(): supplied argument is not a valid stream resource in /homepages/43/d318702296/htdocs/ew/cms/index.php on line 8 Warning: fclose(): supplied argument is not a valid stream resource in /homepages/43/d318702296/htdocs/ew/cms/index.php on line 9 |
Lo-Fi Version | Time is now: 23rd April 2024 - 04:12 PM |