php - Troubleshooting "class not found" error -
anyone tell me why i'm getting error "class 'whois' not found". it's line $whois = new whois(); i'm not sure what.
<form method="post" action=""> <div style="margin:auto;width:300px;"> <label for="domain name">domain check:</label><br /> <input type="text" name="domain" /><br /><br /> <input type="submit" /> </form> <br /> <?php if (isset($_request['domain'])) { // check see if form has been submitted function getwhois($domain, $tld) { require_once("whois.class.php"); $whois = new whois(); if( !$whois->validdomain($domain.'.'.$tld) ){ return 'sorry, domain not valid or not supported.'; } if( $whois->lookup($domain.'.'.$tld) ){ return $whois->getdata(1); }else{ return 'sorry, error occurred.'; } } $domain = trim($_request['domain']); $dot = strpos($domain, '.'); $sld = substr($domain, 0, $dot); $tld = substr($domain, $dot+1); $whois = getwhois($sld, $tld); echo " "; echo $whois; echo " "; } ?> </div>
make sure you're loading right directory
require_once("whois.class.php");
Comments
Post a Comment