| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Nov 2005 Location: on a oil rig just off Ireland
Posts: 1,408
![]() ![]() ![]() ![]() ![]() | Eh? What's wrong with thisCode: Warning: file_get_contents(http://www.bebo.com/grp/Grp.jsp?GrpT...pId=1993135527) [function.file-get-contents]: failed to open stream: Connection timed out in /home/social/public_html/bebo.php on line 37 ????: NamePros.com http://www.namepros.com/programming/301894-eh-whats-wrong-with-this.html file_get_contents("http://www.bebo.com/grp/Grp.jsp?GrpTypeCd=BD&GrpId=1993135527"); Why does it timeout? Doesn't take that long to load. Works fine on my localhost, but not on my server. What sort of restrictions do you think bebo are having? I set the user agent and everything, still times out. Tried curl, times out. Colin
__________________ You design in photoshop, I code into valid XHTML/CSS. Professional PSD, PNG or HTML to tableless XHTML/CSS designs. For more info, send me a PM.
Last edited by tm; 03-06-2007 at 12:56 PM.
|
| |
| | #2 (permalink) |
| NamePros Regular Join Date: May 2004 Location: NYC
Posts: 236
![]() ![]() ![]() | It looks like your server is having trouble resolving domain names. Is your site on a shared/reseller account, or is it on your own vps/dedicated server? If it's on your own vps/dedicated, can you post the contents of resolv.conf? |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Nov 2005 Location: on a oil rig just off Ireland
Posts: 1,408
![]() ![]() ![]() ![]() ![]() | It's on a shared hosting account. Tons of other sites work (in fact, every one I've tried). Can somebody please test this code on their server to see if it works?
__________________ You design in photoshop, I code into valid XHTML/CSS. Professional PSD, PNG or HTML to tableless XHTML/CSS designs. For more info, send me a PM. |
| |
| | #4 (permalink) |
| NamePros Regular Join Date: May 2004 Location: NYC
Posts: 236
![]() ![]() ![]() | Ah, ok. I just ran it with curl on my dedicated server and got this: The URL has moved <a href="http://www.bebo.com/grp/GrpNoCanDo.jsp">here</a> Running curl on the redirected url retrieved a full webpage. Both queries returned in seconds, but the first one hung after printing the redirect line. The page probably has a refresh redirect header which curl and file_get_contents don't follow, hence the "hanging". So...just use the second url and it should work fine.
Last edited by cef; 03-06-2007 at 01:08 PM.
Reason: removed non-working "quote" tag
|
| |
| | THREAD STARTER #6 (permalink) | ||||
| Senior Member Join Date: Nov 2005 Location: on a oil rig just off Ireland
Posts: 1,408
![]() ![]() ![]() ![]() ![]() |
__________________ You design in photoshop, I code into valid XHTML/CSS. Professional PSD, PNG or HTML to tableless XHTML/CSS designs. For more info, send me a PM. | ||||
| |
| | #7 (permalink) |
| NamePros Regular Join Date: May 2004 Location: NYC
Posts: 236
![]() ![]() ![]() | Argh, I'm brain-dead today. Just reran it from the command line, but this time I put quotes around your original url, because of the '&' character: curl "http://www.bebo.com/grp/Grp.jsp?GrpTypeCd=BD&GrpId=1993135527" And it worked fine (the same page came back as I got in the browser). Maybe try urlencoding the string in file_get_contents? |
| |