Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.