OZONE Asylum
Forums
Server-Side Scripting - Oh my!
Hidden url finder on remote server with cURL slow timout
This page's ID:
27781
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Hi all, I've written a php script to find a hidden url on a remote server. the hidden url is in the range: http://www.dummy.com/000001.htm to http://www.dummy.com/999999.htm I thought the best way was to write a php script which validates every link... This is what I've got so far [code]<html> <?php function url_exists($strURL) { $resURL = curl_init(); curl_setopt($resURL, CURLOPT_URL, $strURL); curl_setopt($resURL, CURLOPT_BINARYTRANSFER, 1); curl_setopt($resURL, CURLOPT_HEADERFUNCTION, 'curlHeaderCallback'); curl_setopt($resURL, CURLOPT_FAILONERROR, 1); curl_exec ($resURL); $intReturnCode = curl_getinfo($resURL, CURLINFO_HTTP_CODE); curl_close ($resURL); if ($intReturnCode != 200 && $intReturnCode != 302 && $intReturnCode != 304) { return false; }Else{ return true ; } } for($i = 0; $i < 1000000; $i++) { $j=str_pad($i, 6, "0", STR_PAD_LEFT); $url="http://www.dummy.com/".$j.".htm"; If(url_exists($url)) { Echo"$url"; exit; }Else{ Echo""; } } ?> </html>[/code] Guess what, it's slow and doesn't finish because of script timeouts. 1 - Is this the way to go? 2 - Can I make this script faster? 3 - Will it generate too much traffic on my webserver and will I get into trouble with my provider? Thanks in advance, Sam
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail