Jump to content

file_get_contents error...


MaxMoon

Recommended Posts

I'm trying to grab the contents of a .php page from a directory on my site and echo it on to my blog.  I've done this successfully with .htm pages no problem, but .php seems to be giving me trouble.

 

The code is simply this...

 

<?php 

$emailpage = file_get_contents("http://www..com/signup/index.php"); 
echo $emailpage; 

?>

 

And I get this error:

 

Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/blog/public_html/signup/testing.php on line 3

 

Warning: file_get_contents(http://www..com/signup/index.php) [function.file-get-contents]: failed to open stream: Success in /home/blog/public_html/signup/testing.php on line 3

 

It seemed to be working fine, then I checked an hour later and it was no longer working.  No changes made on my part.  Can anyone help?

 

Thanks,

Stephen

 

Link to comment
https://forums.phpfreaks.com/topic/55365-file_get_contents-error/
Share on other sites

I saw that function today, I'm only familiar with PHP enough to get in to trouble.  Right now file_get_contents() seems to be working.  I tried include() instead and it works, although it displays a "1" at the end of the content.  Know how to get rid of that?

 

Thanks,

Stephen

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.