The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Reading a text file from another server, Reading a simple text file from another website
TheHeist
post 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);
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
TheHeist
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 01:58 AM