Current location: Hot Scripts Forums » Programming Languages » PHP » file_get_contents() function


file_get_contents() function

Reply
  #1 (permalink)  
Old 05-13-05, 06:11 AM
klaniak klaniak is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Underground
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation file_get_contents() function

Now my problem:
failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
when I use file_get_contents() with an url will give me the above eror the function can't load the url it works with other urls, the problem is that the page exists and works but I don't know what happens with file_get_contents() maybe I have to tell the url that I use Mozila 4.0 or something I don't know what could have coused the problem...

What can I do ?
Reply With Quote
  #2 (permalink)  
Old 05-13-05, 10:45 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
"404 Not Found" the page obviously doesnt exist! r u sure the link is correct? copy n paste it in ur browser! make sure there r no spaces in the url...
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #3 (permalink)  
Old 05-13-05, 12:15 PM
klaniak klaniak is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Underground
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
I did that hundred times but I don't know why that error is in it...

[function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server

and the above error, I thought the same but when I copyed and pasted the link it worked... don't know what happened theere

Last edited by klaniak; 05-13-05 at 12:19 PM.
Reply With Quote
  #4 (permalink)  
Old 05-13-05, 06:26 PM
Anastas Anastas is offline
Wannabe Coder
 
Join Date: Mar 2005
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
HTTP request failed! HTTP/1.1 500 Internal Server

Unless if the server is yours, nothing you can do.
Reply With Quote
  #5 (permalink)  
Old 05-13-05, 06:30 PM
klaniak klaniak is offline
Wannabe Coder
 
Join Date: Apr 2005
Location: Underground
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Nice !!!
There is nothing I can do as long as it is his server...
WOW nothing can be done but if I load it in my browser everything works fine
Reply With Quote
  #6 (permalink)  
Old 05-13-05, 06:32 PM
Anastas Anastas is offline
Wannabe Coder
 
Join Date: Mar 2005
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Oh, maybe I was wrong, here's an idea: since PHP is server-side, I don't think entering URLs for getting file contents will work; you will need the absolute path such as

home/username/public_html/dir/dir2/file.php

instead of

http://www.domain.com/dir/dir2/file.php

The first should work, the second shouldn't. Try that, maybe?
Reply With Quote
  #7 (permalink)  
Old 05-14-05, 03:59 AM
Acecool's Avatar
Acecool Acecool is offline
Aspiring Coder
 
Join Date: Nov 2003
Posts: 506
Thanks: 0
Thanked 0 Times in 0 Posts
If HTTP Wrapper is enabled in php, then http://www.example.com/file.ext will work..
__________________
Check Acecoolco.com for PHP Tutorials, and other tuts
If you plan on contacting me, please read this: Legal Terms & Conditions
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrollbar!!!!!! LiLSweetie HTML/XHTML/XML 8 07-22-04 05:01 PM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Disable form fields to be submitted RickyRod JavaScript 2 05-24-04 10:15 AM
accessing existing ISP email with a PHP webmail script. nlancaster PHP 1 01-07-04 03:28 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM


All times are GMT -5. The time now is 06:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.