GIrish BM Posted February 17, 2010 Share Posted February 17, 2010 Hi i am using the following curl function in my php script for domain search , i am getting the following error only when i give "girish" is given in a domain name Error :- It requires lot of time, Link : http://pbminfotech.com/girish/domain/ //--My PHP Script--// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <title>PBMInfotech-Domain Search</title> <link rel="stylesheet" href="css/style.css" type="text/css" /> <body> <form method="POST" action=""> <table> <tr><td> Domain name: <input type="text" name="domain"></td></tr> <tr><td> <input type="checkbox" name="tld[]" checked value=".com"/>.com <input type="checkbox" name="tld[]" value=".org"/>.org <input type="checkbox" name="tld[]" value=".net"/>.net <input type="checkbox" name="tld[]" value=".info"/>.info <input type="checkbox" name="tld[]" value=".mobi"/>.mobi <input type="checkbox" name="tld[]" value=".eu"/>.eu </td></tr> <tr> <td> <input type="checkbox" name="tld[]" value=".me"/>.me <input type="checkbox" name="tld[]" value=".in"/>.in </td> </tr> <tr><td><input type="submit" name="submitBtn" value="Check domain"/></td></tr> </table> </form> </body> </html> <?php if(isset($_POST['submitBtn'])){ $dname = $_POST['domain']; echo '<div class="name">The Following Options Are Avaliable For Your Domain :"<span class=domname>'.$dname.'</span>"</div><br/>'; } function domain_check($domain, $dm) { $val12 = $dm; $data = $domain.$dm; // Create a curl handle to a non-existing location $ch = curl_init($data); //echo $data; // Execute curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); // Check if any error occured if(curl_errno($ch)) { //echo $domain; //echo '<input type=checkbox>'.' '.$domain; echo '<div class="bgimg_avaliable"><input type=checkbox><br/>'.$val12.'</div>'; //echo '<table><tr><td class="bgimg_avaliable"><input type=checkbox align=absmiddle><br/>'.$val12.'</td></tr></table>'; } else { //echo $domain; // echo 'Taken'.' '.$domain; echo '<div class="bgimg_taken">Taken<br/>'.$val12.'</div>'; //echo '<table><tr><td class="bgimg_taken">Taken<br/>'.$val12.'</td></tr></table>'; } // Close handle curl_close($ch); } // Usage: if(isset($_POST['domain'])) { $arr = $_POST['tld']; $v1 =count($arr); if(($v1 =='0') || ($v1 >= '1')){ $arr =array('.com','.org','.net','.info','.mobi','.eu','.me','.in', '.biz', '.co.in'); } //to check in all domain extensions foreach($arr as $var => $val) { echo domain_check($_POST['domain'],$val); } } ?> //--End of the script--// i want to know where i am wrong and how can i fix that bug. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/192351-error-while-using-curl-function-in-domain-search/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.