NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Eh? What's wrong with this

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 03-06-2007, 11:55 AM THREAD STARTER               #1 (permalink)
tm
Senior Member
 
tm's Avatar
Join Date: Nov 2005
Location: on a oil rig just off Ireland
Posts: 1,408
tm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of light
 



Eh? What's wrong with this


Code:
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
The code is obviously
????: 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.
tm is offline  
Old 03-06-2007, 12:46 PM   #2 (permalink)
cef
NamePros Regular
Join Date: May 2004
Location: NYC
Posts: 236
cef is a jewel in the roughcef is a jewel in the roughcef is a jewel in the rough
 


Animal Rescue
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?
cef is offline  
Old 03-06-2007, 12:58 PM THREAD STARTER               #3 (permalink)
tm
Senior Member
 
tm's Avatar
Join Date: Nov 2005
Location: on a oil rig just off Ireland
Posts: 1,408
tm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of light
 



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.
tm is offline  
Old 03-06-2007, 01:07 PM   #4 (permalink)
cef
NamePros Regular
Join Date: May 2004
Location: NYC
Posts: 236
cef is a jewel in the roughcef is a jewel in the roughcef is a jewel in the rough
 


Animal Rescue
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
cef is offline  
Old 03-06-2007, 01:08 PM   #5 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Worked fine for me, but just displayed a bebo error message.

Quote:
Sorry. You do not appear to have permission to view this.
Barrucadu is offline  
Old 03-06-2007, 02:13 PM THREAD STARTER               #6 (permalink)
tm
Senior Member
 
tm's Avatar
Join Date: Nov 2005
Location: on a oil rig just off Ireland
Posts: 1,408
tm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of light
 



Originally Posted by cef
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.
But why does it refresh? It doesn't do it in my browser. And that URL you gave doesn't have the same content as the original URL.
__________________
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.
tm is offline  
Old 03-06-2007, 03:02 PM   #7 (permalink)
cef
NamePros Regular
Join Date: May 2004
Location: NYC
Posts: 236
cef is a jewel in the roughcef is a jewel in the roughcef is a jewel in the rough
 


Animal Rescue
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?
cef is offline  
Closed Thread


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


 
All times are GMT -7. The time now is 02:19 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger