Jump to content

Archived

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

dagnasty

Need advice, not code.

Recommended Posts

So I'm working on a bittorrent search engine.

Here's a sample of what i've gotten done so far http://comptechcomputers.com/tsearch/tsearch.php



What I want to do is get rid of iframes altogether. However, if a site were to not respond to an http search query request it would hold up the whole page until cURL spit out an error or the site finally responded to the request.

My question:

How would I go about finding out if a torrent site (a page in particular)is responding to http requests. Is there a way to send a short request for maybe http headers (?) instead of the whole page, and set a timeout limit of maybe 3 seconds so it doesn't hold up the page's loading terribly slow if in fact the site isn't responding?

A simple ping would not suffice, of course, because it doesn't not tell if an http server is up on it.



Share this post


Link to post
Share on other sites
I've never used CURL myself, but it looks like you can do this based on the manual page:

[code]curl_setopt($cUrl, CURLOPT_TIMEOUT, 'timeout_in_seconds');[/code]

Share this post


Link to post
Share on other sites
Thanks! I looked through it but I didn't know if there was a way to check to see if it timed out then I realized there's a way to get outputted errors. Hopefully this works!

Share this post


Link to post
Share on other sites
when the page times out it doesnt output an error. However, when a host cannot be found ex. www.dasfklfsdklfdsljsfd.com it does. Kinda sucks :(

Ideas anyone?

Share this post


Link to post
Share on other sites

×

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.