Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Need help with search bar + html

abemporat

Coder
Hi guys!

Im trying to develp a search bar for IMEI look ups,

Basically when you put your imei, click search and the results will pop up.

I have the API Key for the database of the imei results, i just need a code to put a searchbar with the API key integrated in order for it to work correctly.

I hope that i explained correctly, if not, feel free to ask

Thanks for all the help beforehand.
 
I tried with an html coded search bar, but i dont seem to understand how to insert the api key code.

Maybe someone has more knowledge on this?

I need the searchbar to look for the imei information (provided by the api key) and display it on my site.

I have tried and read a lot of articles/forums to try to get to this but nothing so far.

Hoping to hear from anyone soon!

Thanks before hand
 
Hey there. I'm not exactly going to help you directly with the programming but I'm just gonna give a bit of advice and a couple of suggestions too.

Let's hop in.
abemporat said:
I tried with an html coded search bar, but i dont seem to understand how to insert the api key code.
So, first of all, you cannot write a search-bar in HTML. HTML is a mark-up language, not a scripting or programming-language. What you write in a HTML document, is then rendered by a web-browser, and displayed on a page. No calculations or that are performed. If you want to do things such as calculations or a search-bar, you'll need either JavaScript, PHP, Ruby/Ruby-On-Rails, Python, or Java.

The thing is, you can embed scripts into HTML using the <script></script> tag. That though, by itself, is for JavaScript code. If you want to embed PHP code, then you put <?php ?> inside the HTML document. So:
Code:
<?php
     // Your code here.
?>
That's how you'd embed a PHP script into a HTML document. For JavaScript, as I said, you just need the <script></script> tag, and then you just write your JavaScript in that. Although, you can actually embed .js(JavaScript files), using the <link> tag.

W3Schools has a couple of pages regarding the <script></script> and <link> tags. I suggest giving them a read:

Seeing as this is an API, could you perhaps link to where you got it? If you can, then maybe we can dig through the API's website, and then possibly after some digging around, we can help you then. Also, do you know if the API has any documentation available for yourself to read through? Perhaps if you dig through the documentation, you can find something useful in it.
 
Hey there. I'm not exactly going to help you directly with the programming but I'm just gonna give a bit of advice and a couple of suggestions too.

Let's hop in.

So, first of all, you cannot write a search-bar in HTML. HTML is a mark-up language, not a scripting or programming-language. What you write in a HTML document, is then rendered by a web-browser, and displayed on a page. No calculations or that are performed. If you want to do things such as calculations or a search-bar, you'll need either JavaScript, PHP, Ruby/Ruby-On-Rails, Python, or Java.

The thing is, you can embed scripts into HTML using the <script></script> tag. That though, by itself, is for JavaScript code. If you want to embed PHP code, then you put <?php ?> inside the HTML document. So:
Code:
<?php
     // Your code here.
?>
That's how you'd embed a PHP script into a HTML document. For JavaScript, as I said, you just need the <script></script> tag, and then you just write your JavaScript in that. Although, you can actually embed .js(JavaScript files), using the <link> tag.

W3Schools has a couple of pages regarding the <script></script> and <link> tags. I suggest giving them a read:

Seeing as this is an API, could you perhaps link to where you got it? If you can, then maybe we can dig through the API's website, and then possibly after some digging around, we can help you then. Also, do you know if the API has any documentation available for yourself to read through? Perhaps if you dig through the documentation, you can find something useful in it.
Hello!

Thank you so much, I'll give it my best shot, I'm sorta new to all the coding world.

The API is here: https://rapidapi.com/ismaelc/api/imei-info

Let me know if there is a way you can help me further,

Appreciate all the help beforehand!
 
abemporat said:
Hello!

Thank you so much, I'll give it my best shot, I'm sorta new to all the coding world.
No problem. There are many people here on CF who are also new to programming, but you're just one of those several people.

Feel free to look around here for tutorials on how to do things. Many tutorials are being written by regular members and staff-members too, so keep an eye out for them. Also, seeing as this is a website that you're working on, consider checking out W3Schools and MDN(Mozilla Developer Network) for resources and learning-material on HTML5, CSS, JS, and PHP. For PHP though, I'd suggest reading the documentation over at PHP's official site: https://www.php.net

I say this because in my opinion, W3Schools's tutorials on PHP are terrible and poorly detailed, and MDN doesn't offer any resources on PHP, which is a bummer for some.

abemporat said:
Thanks for sharing the API with us. Everyone who gets involved in this thread, I suppose will be looking through it to find ways to help you. In the meantime, as I said, head over to W3Schools, MDN, and PHP's official site to learn a bit about HTML, CSS, JS, and if you choose(Or if the API requires it), PHP. Once you learn a bit about each of the languages, I suggest going over the APIs documentation yourself to see how everything works and connects together.

As for your learning again, set aside an hour or two everyday to learn a bit, with breaks in-between of course.
 
Thank you so much, I'll give it my best shot, I'm sorta new to all the coding world.
Like @Mathematical many coders on Code Forum are new as well. But no matter what you're skill level is you'll always be welcomed here at Code Forum. As a community we will help each other.

The API is here: https://rapidapi.com/ismaelc/api/imei-info

Let me know if there is a way you can help me further,

Appreciate all the help beforehand!
Thank you for providing the API this will help others to help find you a solution. Of course, please don't be shy, look around perhaps ask questions that may help you find a solution to this thread. Again, like @Mathematical suggested head to MDN, w3schools or even search on Google and perhaps touch up on HTML, CSS, JS and PHP.
 
Ok so;

I got a lil hang of it now, this is the php file i want to edit, its already built up to work for DOMAIN SEARCH, but i need to integrate it for the IMEI SEARCH with the api:

[CODE lang="php" title="Search Plugin CODE"]<?php
/**
* Class responsible for checking if a domain is registered
*
*
* @param boolean $error_reporting Set if the function should display errors or suppress them, default is false
* @return boolean true means the domain is NOT registered
*/
class Auxpro_Domain_Checker {

private $error_reporting;


public function __construct($debug = false) {
if ( $debug ) {
error_reporting(E_ALL);
$error_reporting = true;
} else {
error_reporting(0);
$error_reporting = false;
}

}


/**
* This function checks if the supplied domain name is registered
*
*
* @param string $domain The domain that will be checked for registration.
* @param boolean $error_reporting Set if the function should display errors or suppress them, default is TRUE
* @return boolean true means the domain is NOT registered
*/
public function is_available($domain) {

// make the domain lowercase
$domain = strtolower($domain);

// Set the timeout (in seconds) for the socket open function.
$timeout = 10;



/**
* This array contains the list of WHOIS servers and the "domain not found" string
* to be searched for to check if the domain is available for registration.
*
* NOTE: The "domain not found" string may change at any time for any reason.
*/
$whois_arr = array(
"com" => array("whois.verisign-grs.com", "No match for"),
"net" => array("whois.verisign-grs.com", "No match for "),
"org" => array("whois.pir.org", "NOT FOUND"),
"co.uk" => array("whois.nic.uk", "No match for "),
"io" => array("whois.nic.io", "is available for purchase"),
"computer" => array( "whois.donuts.co", "Domain not found."),
"ac" => array("whois.nic.ac","is available for purchase"),
"academy" => array("whois.donuts.co","Domain not found."),
"actor" => array("whois.unitedtld.com","Domain not found."),
"ae" => array("whois.aeda.net.ae","No Data Found"),
"aero" => array("whois.aero","NOT FOUND"),
"af" => array("whois.nic.af","Domain Status: No Object Found"),
"ag" => array("whois.nic.ag","NOT FOUND"),
"agency" => array("whois.donuts.co","Domain not found."),
"ai" => array("whois.ai","If you would like to register this, or any .ai domain"),
"am" => array("whois.amnic.net","No match"),
"archi" => array("whois.ksregistry.net","not found..."),
"arpa" => array("whois.iana.org","% This query returned 0 objects."),
"as" => array("whois.nic.as","Domain Status: Available"),
"asia" => array("whois.nic.asia","NOT FOUND"),
"associates" => array("whois.donuts.co","Domain not found."),
"at" => array("whois.nic.at","% nothing found"),
"au" => array("whois.audns.net.au","NOT FOUND"),
"aw" => array("whois.nic.aw"," is free"),
"ax" => array("whois.ax","No records matching "),
"az" => array("whois.az","MATCH"), // not responding
"bar" => array("whois.nic.bar","DOMAIN NOT FOUND"),
"bargains" => array("whois.donuts.co","Domain not found."),
"be" => array("whois.dns.be","Status: AVAILABLE"),
"berlin" => array("whois.nic.berlin","% No match"),
"bg" => array("whois.register.bg","does not exist in database!"),
"bi" => array("whois1.nic.bi","Domain Status: No Object Found"),
"bike" => array("whois.donuts.co","Domain not found."),
"biz" => array("whois.biz","Not found: "),
"bj" => array("whois.nic.bj","No records matching"),
"blackfriday" => array("whois.uniregistry.net","is available for"),
"bn" => array("whois.bn","No records matching"),
"boutique" => array("whois.donuts.co","Domain not found."),
"build" => array("whois.nic.build","No Data Found"),
"builders" => array("whois.donuts.co","Domain not found."),
"bw" => array("whois.nic.net.bw","Domain Status: No Object Found"),
"by" => array("whois.cctld.by","Object does not exist"),
"ca" => array("whois.cira.ca","Domain status: available"),
"cab" => array("whois.donuts.co","Domain not found."),
"camera" => array("whois.donuts.co","Domain not found."),
"camp" => array("whois.donuts.co","Domain not found."),
"captial" => array("whois.donuts.co","Domain not found."),
"cards" => array("whois.donuts.co","Domain not found."),
"careers" => array("whois.donuts.co","Domain not found."),
"cat" => array("whois.cat","NOT FOUND."),
"catering" => array("whois.donuts.co","Domain not found."),
"cc" => array("ccwhois.verisign-grs.com","No match for"),
"center" => array("whois.donuts.co","Domain not found."),
"ceo" => array("whois.nic.ceo","Not found:"),
"cf" => array("whois.dot.cf","Invalid query or domain name not known in Dot CF Domain Registry"),
"ch" => array("whois.nic.ch","We do not have an entry in our database matching your query."),
"cheap" => array("whois.donuts.co","Domain not found."),
"christmas" => array("whois.uniregistry.net","is available for registration"),
"ci" => array("whois.nic.ci","not found"),
"cl" => array("whois.nic.cl",": no existe"),
"cleaning" => array("whois.donuts.co","Domain not found."),
"clothing" => array("whois.donuts.co","Domain not found."),
"club" => array("whois.nic.club","Not found:"),
"cn" => array("whois.cnnic.cn","no matching record."),
"co" => array("whois.nic.co","Not found:"),
"codes" => array("whois.donuts.co","Domain not found."),
"coffee" => array("whois.donuts.co","Domain not found."),
"college" => array("whois.centralnic.com","DOMAIN NOT FOUND"),
"cologne" => array("whois-fe1.pdt.cologne.tango.knipp.de","no matching objects found"),
"community" => array("whois.donuts.co","Domain not found."),
"company" => array("whois.donuts.co","Domain not found."),
"construction" => array("whois.donuts.co","Domain not found."),
"contractors" => array("whois.donuts.co","Domain not found."),
"cooking" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"cool" => array("whois.donuts.co","Domain not found."),
"coop" => array("whois.nic.coop","No domain records were found to match"),
"country" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"cruises" => array("whois.donuts.co","Domain not found."),
"cx" => array("whois.nic.cx","Domain Status: No Object Found"),
"cz" => array("whois.nic.cz","No entries found."),
"dating" => array("whois.donuts.co","Domain not found."),
"de" => array("whois.denic.de","Status: free"),
"democrat" => array("whois.unitedtld.com","Domain not found."),
"desi" => array("whois.ksregistry.net","not found..."),
"diamonds" => array("whois.donuts.co","Domain not found."),
"directory" => array("whois.donuts.co","Domain not found."),
"dk" => array("whois.dk-hostmaster.dk","No entries found for the selected source."),
"dm" => array("whois.nic.dm","not found..."),
"domains" => array("whois.donuts.co","Domain not found."),
"dz" => array("whois.nic.dz","NO OBJECT FOUND!"),
"ec" => array("whois.nic.ec","Status: Not Registered"),
"edu" => array("whois.educause.edu","No Match"),
"education" => array("whois.donuts.co","Domain not found."),
"ee" => array("whois.tld.ee","No entries found."),
"email" => array("whois.donuts.co","Domain not found."),
"engineering" => array("whois.donuts.co","Domain not found."),
"enterprises" => array("whois.donuts.co","Domain not found."),
"equipment" => array("whois.donuts.co","Domain not found."),
//"es" => array("whois.nic.es","MATCH"), // You need your IP to be whitelisted, read more: https://sede.red.gob.es/eRegistro/inicio.action
"estate" => array("whois.donuts.co","Domain not found."),
"eu" => array("whois.eu","Status: AVAILABLE"),
"eus" => array("whois.eus.coreregistry.net","no matching objects found"),
"events" => array("whois.donuts.co","Domain not found."),
"expert" => array("whois.donuts.co","Domain not found."),
"exposed" => array("whois.donuts.co","Domain not found."),
"farm" => array("whois.donuts.co","Domain not found."),
"feedback" => array("whois.centralnic.com","DOMAIN NOT FOUND"),
"fi" => array("whois.fi","Domain not found"),
"fish" => array("whois.donuts.co","Domain not found."),
"fishing" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"flights" => array("whois.donuts.co","Domain not found."),
"florist" => array("whois.donuts.co","Domain not found."),
"fo" => array("whois.nic.fo","No entries found."),
"foo" => array("domain-registry-whois.l.google.com","Domain not found"),
"foundation" => array("whois.donuts.co","Domain not found."),
"fr" => array("whois.nic.fr","No entries found"),
"frogans" => array("whois-frogans.nic.fr","Requested Domain cannot be found"),
"futbol" => array("whois.unitedtld.com","Domain not found."),
"ga" => array("whois.gal.coreregistry.net","no matching objects found"),
"gal" => array("whois.donuts.co","Domain not found."),
"gd" => array("whois.nic.gd","not found..."),
"gg" => array("whois.gg","Domain Status: No Object Found"),
"gi" => array("whois2.afilias-grs.net","NOT FOUND"),
"gift" => array("whois.uniregistry.net","is available for registration"),
"gl" => array("whois.nic.gl","Domain Status: No Object Found"),
"glass" => array("whois.donuts.co","Domain not found."),
"gop" => array("whois-cl01.mm-registry.com","Status: Not Registered"),
"gov" => array("whois.nic.gov","No match for"),
"graphics" => array("whois.donuts.co","Domain not found."),
"gripe" => array("whois.donuts.co","Domain not found."),
"gs" => array("whois.nic.gs","Domain Status: No Object Found"),
"guitars" => array("whois.uniregistry.net","is available for registration"),
"guru" => array("whois.donuts.co","Domain not found."),
"gy" => array("whois.registry.gy","Domain Status: No Object Found"),
"haus" => array("whois.unitedtld.com","Domain not found."),
"hk" => array("whois.hkirc.hk","The domain has not been registered."),
"hn" => array("whois.nic.hn","Domain Status: No Object Found"),
"holiday" => array("whois.donuts.co","Domain not found."),
"horse" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"house" => array("whois.donuts.co","Domain not found."),
"hr" => array("whois.dns.hr","ERROR: no entries found"),
"ht" => array("whois.nic.ht","Domain Status: No Object Found"),
"hu" => array("whois.nic.hu","No match"),
"id" => array("whois.pandi.or.id","DOMAIN NOT FOUND"),
"ie" => array("whois.domainregistry.ie","Not Registered"),
"il" => array("whois.isoc.org.il","No data was found to match the request criteria."),
"im" => array("whois.nic.im","was not found."),
"immobilien" => array("whois.unitedtld.com","Domain not found."),
"in" => array("whois.inregistry.net","NOT FOUND"),
"industries" => array("whois.donuts.co","Domain not found."),
"institute" => array("whois.donuts.co","Domain not found."),
"int" => array("whois.iana.org","This query returned 0 objects."),
"international" => array("whois.donuts.co","Domain not found."),
"iq" => array("whois.cmc.iq","Domain Status: No Object Found"),
"ir" => array("whois.nic.ir","No entries found in the selected"),
"is" => array("whois.isnic.is","No entries found for query"),
"it" => array("whois.nic.it","Status: AVAILABLE"),
"je" => array("whois.je","Domain Status: No Object Found"),
"jobs" => array("jobswhois.verisign-grs.com","No match for"),
"jp" => array("whois.jprs.jp","No match!!"),
"kaufen" => array("whois.unitedtld.com","Domain not found."),
"ke" => array("whois.kenic.or.ke","Status: Not Registered"),
"kg" => array("whois.domain.kg","Data not found. This domain is available for registration."),
"ki" => array("whois.nic.ki","Domain Status: No Object Found"),
"kitchen" => array("whois.donuts.co","Domain not found."),
"kiwi" => array("whois.dot-kiwi.com","Status: Not Registered"),
"koeln" => array("whois-fe1.pdt.koeln.tango.knipp.de","no matching objects found"),
"kr" => array("whois.kr","Above domain name is not registered to KRNIC."),
"kz" => array("whois.nic.kz","Nothing found for this query."),
"la" => array("whois.nic.la","DOMAIN NOT FOUND"),
"land" => array("whois.donuts.co","Domain not found."),
"lease" => array("whois.donuts.co","Domain not found."),
"li" => array("whois.nic.li","We do not have an entry in our database matching your query"),
"lighting" => array("whois.donuts.co","Domain not found."),
"limo" => array("whois.donuts.co","Domain not found."),
"link" => array("whois.uniregistry.net","is available for registration"),
"london" => array("whois-lon.mm-registry.com","Status: Not Registered"),
"lt" => array("whois.domreg.lt","Status: available"),
"lu" => array("whois.dns.lu","No such domain"),
"luxury" => array("whois.nic.luxury","No Data Found"),
"lv" => array("whois.nic.lv","Status: free"),
"ly" => array("whois.nic.ly","Not found"),
"ma" => array("whois.iam.net.ma","No Objects Found"),
"management" => array("whois.donuts.co","Domain not found."),
"mango" => array("whois.mango.coreregistry.net","no matching objects found"),
"marketing" => array("whois.donuts.co","Domain not found."),
"md" => array("whois.nic.md","No match for"),
"me" => array("whois.nic.me","NOT FOUND"),
"media" => array("whois.donuts.co","Domain not found."),
"menu" => array("whois.nic.menu","No Data Found"),
"mg" => array("whois.nic.mg","Domain Status: Available"),
"miami" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"mk" => array("whois.marnet.mk","no entries found"),
"ml" => array("whois.dot.ml","domain name not known"),
"mn" => array("whois.nic.mn","MATCH"), // not responding
"mo" => array("whois.monic.mo","No match for"),
"mobi" => array("whois.dotmobiregistry.net","NOT FOUND"),
"moda" => array("whois.unitedtld.com","Domain not found."),
"monash" => array("whois.nic.monash","No Data Found"),
"mp" => array("whois.nic.mp","MATCH"), // not responding
"ms" => array("whois.nic.ms","Domain Status: No Object Found"),
"mu" => array("whois.nic.mu","Domain Status: No Object Found"),
"museum" => array("whois.museum","NOT FOUND."),
"mx" => array("whois.mx","Object_Not_Found"),
"my" => array("whois.domainregistry.my","does not exist in database"),
"na" => array("whois.na-nic.com.na","Domain Status: No Object Found"),
"name" => array("whois.nic.name","No match for"),
"nc" => array("whois.nc","No entries found in the .nc database"),
"nf" => array("whois.nic.nf","Domain Status: No Object Found"),
"ng" => array("whois.nic.net.ng","Domain Status: Available"),
"ninja" => array("whois.unitedtld.com","Domain not found."),
"nl" => array("whois.domain-registry.nl","is free"),
"no" => array("whois.norid.no","% No match"),
"nu" => array("whois.iis.nu","not found."),
"nz" => array("whois.srs.net.nz","220 Available"),
"om" => array("whois.registry.om","No Data Found"),
"onl" => array("whois.afilias-srs.net","NOT FOUND"),
"paris" => array("whois-paris.nic.fr","Requested Domain cannot be found"),
"partners" => array("whois.donuts.co","Domain not found."),
"parts" => array("whois.donuts.co","Domain not found."),
"pe" => array("kero.yachay.pe","Status: Not Registered"),
"pf" => array("whois.registry.pf","Domain unknown"),
"photo" => array("whois.uniregistry.net","is available for registration"),
"photography" => array("whois.donuts.co","Domain not found."),
"photos" => array("whois.donuts.co","Domain not found."),
"pics" => array("whois.uniregistry.net","is available for registration"),
"pictures" => array("whois.donuts.co","Domain not found."),
"pl" => array("whois.dns.pl","No information available"),
"plumbing" => array("whois.donuts.co","Domain not found."),
"pm" => array("whois.nic.pm","No entries found"),
"post" => array("whois.dotpostregistry.net","NOT FOUND"),
"pr" => array("whois.nic.pr","is not registered."),
"pro" => array("whois.dotproregistry.net","NOT FOUND"),
"productions" => array("whois.donuts.co","Domain not found."),
"properties" => array("whois.donuts.co","Domain not found."),
"pt" => array("whois.dns.pt","no match"),
"pub" => array("whois.unitedtld.com","Domain not found."),
"pw" => array("whois.nic.pw","DOMAIN NOT FOUND"),
"qa" => array("whois.registry.qa","No Data Found"),
"quebec" => array("whois.quebec.rs.corenic.net","no matching objects found"),
"re" => array("whois.nic.re","No entries found"),
"recipes" => array("whois.donuts.co","Domain not found."),
"reisen" => array("whois.donuts.co","Domain not found."),
"rentals" => array("whois.donuts.co","Domain not found."),
"repair" => array("whois.donuts.co","Domain not found."),
"report" => array("whois.donuts.co","Domain not found."),
"rest" => array("whois.centralnic.com","DOMAIN NOT FOUND"),
"reviews" => array("whois.unitedtld.com","Domain not found."),
"rich" => array("whois.afilias-srs.net","NOT FOUND"),
"ro" => array("whois.rotld.ro","No entries found"),
"rocks" => array("whois.unitedtld.com","Domain not found."),
"rodeo" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"rs" => array("whois.rnids.rs","Domain is not registered"),
"ru" => array("whois.tcinet.ru","No entries found"),
"ruhr" => array("whois.nic.ruhr","no matching objects found"),
"sa" => array("whois.nic.net.sa","No Match for"),
"saarland" => array("whois.ksregistry.net","not found..."),
"sb" => array("whois.nic.net.sb","Domain Status: No Object Found"),
"sc" => array("whois2.afilias-grs.net","NOT FOUND"),
"se" => array("whois.iis.se","not found."),
"services" => array("whois.donuts.co","Domain not found."),
"sexy" => array("whois.uniregistry.net","is available for"),
"sg" => array("whois.sgnic.sg","Domain Not Found"),
"sh" => array("whois.nic.sh","is available for purchase"),
"shoes" => array("whois.donuts.co","Domain not found."),
"si" => array("whois.arnes.si","No entries found"),
"singles" => array("whois.donuts.co","Domain not found."),
"sk" => array("whois.sk-nic.sk","Not found."),
"sm" => array("whois.nic.sm","No entries found."),
"sn" => array("whois.nic.sn","NOT FOUND"),
"so" => array("whois.nic.so","DOMAIN NOT FOUND"),
"social" => array("whois.unitedtld.com","Domain not found."),
"solar" => array("whois.donuts.co","Domain not found."),
"solutions" => array("whois.donuts.co","Domain not found."),
"soy" => array("domain-registry-whois.l.google.com","Domain not found"),
"st" => array("whois.nic.st","No entries found"),
"su" => array("whois.tcinet.ru","No entries found"),
"supplies" => array("whois.donuts.co","Domain not found."),
"supply" => array("whois.donuts.co","Domain not found."),
"support" => array("whois.donuts.co","Domain not found."),
"sx" => array("whois.sx","Status: AVAILABLE"),
"sy" => array("whois.tld.sy","Domain Status: Available"),
"systems" => array("whois.donuts.co","Domain not found."),
"tattoo" => array("whois.uniregistry.net","is available for registration"),
"tc" => array("whois.meridiantld.net","Domain Status: No Object Found"),
"technology" => array("whois.donuts.co","Domain not found."),
"tel" => array("whois.nic.tel","Not found:"),
"tf" => array("whois.nic.tf","No entries found"),
"th" => array("whois.thnic.co.th","No match for"),
"tienda" => array("whois.donuts.co","Domain not found."),
"tips" => array("whois.donuts.co","Domain not found."),
"tk" => array("whois.dot.tk","Invalid query or domain name not known"),
"tl" => array("whois.nic.tl","Domain Status: No Object Found"),
"tm" => array("whois.nic.tm","is available for purchase"),
"tn" => array("whois.ati.tn","NO OBJECT FOUND!"),
"to" => array("whois.tonic.to","No match for"),
"today" => array("whois.donuts.co","Domain not found."),
"tools" => array("whois.donuts.co","Domain not found."),
"town" => array("whois.donuts.co","Domain not found."),
"toys" => array("whois.donuts.co","Domain not found."),
"tr" => array("whois.nic.tr","No match found for"),
"training" => array("whois.donuts.co","Domain not found."),
"travel" => array("whois.nic.travel","Not found:"),
"tv" => array("tvwhois.verisign-grs.com","No match for"),
"tw" => array("whois.twnic.net.tw","No Found"),
"tz" => array("whois.tznic.or.tz","No entries found."),
"ua" => array("whois.ua","No entries found for"),
"ug" => array("whois.co.ug","No entries found for the selected source(s)."),
"uk" => array("whois.nic.uk","This domain name has not been registered."),
"university" => array("whois.donuts.co","Domain not found."),
"us" => array("whois.nic.us","Not found"),
"uy" => array("whois.nic.org.uy","No match for"),
"black" => array("whois.afilias.net","NOT FOUND"),
"blue" => array("whois.afilias.net","NOT FOUND"),
"info" => array("whois.afilias.net","NOT FOUND"),
"kim" => array("whois.afilias.net","NOT FOUND"),
"pink" => array("whois.afilias.net","NOT FOUND"),
"red" => array("whois.afilias.net","NOT FOUND"),
"shiksha" => array("whois.afilias.net","NOT FOUND"),
"uz" => array("whois.cctld.uz","not found in database"),
"vacations" => array("whois.donuts.co","Domain not found."),
"vc" => array("whois2.afilias-grs.net","NOT FOUND"),
"ve" => array("whois.nic.ve","No match for"),
"vegas" => array("whois.afilias-srs.net","NOT FOUND"),
"ventures" => array("whois.donuts.co","Domain not found."),
"vg" => array("ccwhois.ksregistry.net","not found..."),
"viajes" => array("whois.donuts.co","Domain not found."),
"villas" => array("whois.donuts.co","Domain not found."),
"vision" => array("whois.donuts.co","Domain not found."),
"vodka" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"voting" => array("whois.voting.tld-box.at","No match"),
"voyage" => array("whois.donuts.co","Domain not found."),
"vu" => array("vunic.vu","is not valid!"),
"wang" => array("whois.gtld.knet.cn","No match"),
"watch" => array("whois.donuts.co","Domain not found."),
"wed" => array("whois.nic.wed","Domain Status: No Object Found"),
"wf" => array("whois.nic.wf","No entries found in the AFNIC Database."),
"wien" => array("whois.nic.wien","No match"),
"wiki" => array("whois.nic.wiki","DOMAIN NOT FOUND"),
"works" => array("whois.donuts.co","Domain not found."),
"ws" => array("whois.website.ws","No match for"),
"xxx" => array("whois.nic.xxx","NOT FOUND"),
"xyz" => array("whois.nic.xyz","DOMAIN NOT FOUND"),
"yt" => array("whois.nic.yt","No entries found in the AFNIC Database."),
"ryukyu" => array("whois.nic.ryukyu", "DOMAIN NOT FOUND"),
"zm" => array("whois.nic.zm","Domain Status: No Object Found"),
"zone" => array( "whois.donuts.co","Domain not found."),
"scot" => array("whois.nic.scot","no matching objects found"),
"br" => array("whois.nic.br","No match for"),
"engineer" => array("whois.nic.engineer","Domain not found"),
"gifts" => array("whois.nic.gifts","Domain not found"),
"quebec" => array("whois.nic.quebec","no matching objects found"),
"restaurant" => array("whois.nic.restaurant","Domain not found"),
"sarl" => array("whois.nic.sarl","Domain not found"),
"click" => array("whois.nic.click","is available for registration"),
"host" => array("whois.nic.host","DOMAIN NOT FOUND"),
"hosting" => array("whois.nic.hosting","is available for registration"),
"trade" => array("whois.nic.trade","Not found"),
"career" => array("whois.nic.career|No match for"),
"diet" => array("whois.nic.diet","is available for registration"),
"help" => array("whois.nic.help","is available for registration"),
"jobs" => array("jobswhois.verisign-grs.com","No match for"),
"property" => array("whois.nic.property","is available for registration"),
"beer" => array("whois.nic.beer","Not Registered"),
"direct" => array("whois.nic.direct","Domain not found"),
"place" => array("whois.nic.place","Domain not found"),
"surf" => array("whois.nic.surf","Not Registered"),
"healthcare" => array("whois.donuts.co","Domain not found"),
"army" => array("whois.unitedtld.com","Domain not found"),
"navy" => array("whois.unitedtld.com","Domain not found"),
"airforce" => array("whois.unitedtld.com","Domain not found"),
"vet" => array("whois.unitedtld.com","Domain not found"),
"za" => array("whois.co.za","Available")
);


// gethostbyname returns the same string if it cant find the domain,
// we do a further check to see if it is a false positive
//if (gethostbyname($domain) == $domain) {
// get the TLD of the domain
$tld = $this->get_tld($domain);

// If an entry for the TLD exists in the whois array
if (isset($whois_arr[$tld][0])) {
// set the hostname for the whois server
$whois_server = $whois_arr[$tld][0];

// set the "domain not found" string
$bad_string = $whois_arr[$tld][1];
} else {
// TODO: REFACTOR THIS
// TLD is not in the whois array, die
//throw new Exception("WHOIS server not found for that TLD");
return '2';
}

$status = $this->checkDomainNameAvailabilty($domain,$whois_server,$bad_string);

return $status;
//} else {
// not available
// return FALSE;
//}

}


/**
* Extracts the TLD from a domain, supports URLS with "www." at the beginning.
*
*
* @param string $domain The domain that will get it's TLD extracted
* @return string The TLD for $domain
*/

public function get_tld ($domain) {
$split = explode('.', $domain);

if(count($split) === 0) {
throw new Exception('Invalid domain extension');

}
return end($split);
}

public function checkDomainNameAvailabilty($domain_name, $whois_server, $find_text){

// Open a socket connection to the whois server
$con = fsockopen($whois_server, 43);
if (!$con) return false;

// Send the requested domain name
fputs($con, $domain_name."\r\n");

// Read and store the server response
$response = " :";
while(!feof($con))
$response .= fgets($con,128);

// Close the connection
fclose($con);

// Check the Whois server response
if (strpos(strtolower($response), strtolower($find_text)))
return '1';
else
return '0';
}
}
[/CODE]

I also changed the API, here is a screenshot

Screen Shot 2020-04-02 at 6.59.12 PM.png

Appreciate the help!
 
Ok so;

I got a lil hang of it now, this is the php file i want to edit, its already built up to work for DOMAIN SEARCH, but i need to integrate it for the IMEI SEARCH with the api:

<?php
//
<?php
/**
* Class responsible for checking if a domain is registered
*
*
* @param boolean $error_reporting Set if the function should display errors or suppress them, default is false
* @return boolean true means the domain is NOT registered
*/
class Auxpro_Domain_Checker {

private $error_reporting;


public function __construct($debug = false) {
if ( $debug ) {
error_reporting(E_ALL);
$error_reporting = true;
} else {
error_reporting(0);
$error_reporting = false;
}

}


/**
* This function checks if the supplied domain name is registered
*
*
* @param string $domain The domain that will be checked for registration.
* @param boolean $error_reporting Set if the function should display errors or suppress them, default is TRUE
* @return boolean true means the domain is NOT registered
*/
public function is_available($domain) {

// make the domain lowercase
$domain = strtolower($domain);

// Set the timeout (in seconds) for the socket open function.
$timeout = 10;



/**
* This array contains the list of WHOIS servers and the "domain not found" string
* to be searched for to check if the domain is available for registration.
*
* NOTE: The "domain not found" string may change at any time for any reason.
*/
$whois_arr = array(
"com" => array("whois.verisign-grs.com", "No match for"),
"net" => array("whois.verisign-grs.com", "No match for "),
"org" => array("whois.pir.org", "NOT FOUND"),
"co.uk" => array("whois.nic.uk", "No match for "),
"io" => array("whois.nic.io", "is available for purchase"),
"computer" => array( "whois.donuts.co", "Domain not found."),
"ac" => array("whois.nic.ac","is available for purchase"),
"academy" => array("whois.donuts.co","Domain not found."),
"actor" => array("whois.unitedtld.com","Domain not found."),
"ae" => array("whois.aeda.net.ae","No Data Found"),
"aero" => array("whois.aero","NOT FOUND"),
"af" => array("whois.nic.af","Domain Status: No Object Found"),
"ag" => array("whois.nic.ag","NOT FOUND"),
"agency" => array("whois.donuts.co","Domain not found."),
"ai" => array("whois.ai","If you would like to register this, or any .ai domain"),
"am" => array("whois.amnic.net","No match"),
"archi" => array("whois.ksregistry.net","not found..."),
"arpa" => array("whois.iana.org","% This query returned 0 objects."),
"as" => array("whois.nic.as","Domain Status: Available"),
"asia" => array("whois.nic.asia","NOT FOUND"),
"associates" => array("whois.donuts.co","Domain not found."),
"at" => array("whois.nic.at","% nothing found"),
"au" => array("whois.audns.net.au","NOT FOUND"),
"aw" => array("whois.nic.aw"," is free"),
"ax" => array("whois.ax","No records matching "),
"az" => array("whois.az","MATCH"), // not responding
"bar" => array("whois.nic.bar","DOMAIN NOT FOUND"),
"bargains" => array("whois.donuts.co","Domain not found."),
"be" => array("whois.dns.be","Status: AVAILABLE"),
"berlin" => array("whois.nic.berlin","% No match"),
"bg" => array("whois.register.bg","does not exist in database!"),
"bi" => array("whois1.nic.bi","Domain Status: No Object Found"),
"bike" => array("whois.donuts.co","Domain not found."),
"biz" => array("whois.biz","Not found: "),
"bj" => array("whois.nic.bj","No records matching"),
"blackfriday" => array("whois.uniregistry.net","is available for"),
"bn" => array("whois.bn","No records matching"),
"boutique" => array("whois.donuts.co","Domain not found."),
"build" => array("whois.nic.build","No Data Found"),
"builders" => array("whois.donuts.co","Domain not found."),
"bw" => array("whois.nic.net.bw","Domain Status: No Object Found"),
"by" => array("whois.cctld.by","Object does not exist"),
"ca" => array("whois.cira.ca","Domain status: available"),
"cab" => array("whois.donuts.co","Domain not found."),
"camera" => array("whois.donuts.co","Domain not found."),
"camp" => array("whois.donuts.co","Domain not found."),
"captial" => array("whois.donuts.co","Domain not found."),
"cards" => array("whois.donuts.co","Domain not found."),
"careers" => array("whois.donuts.co","Domain not found."),
"cat" => array("whois.cat","NOT FOUND."),
"catering" => array("whois.donuts.co","Domain not found."),
"cc" => array("ccwhois.verisign-grs.com","No match for"),
"center" => array("whois.donuts.co","Domain not found."),
"ceo" => array("whois.nic.ceo","Not found:"),
"cf" => array("whois.dot.cf","Invalid query or domain name not known in Dot CF Domain Registry"),
"ch" => array("whois.nic.ch","We do not have an entry in our database matching your query."),
"cheap" => array("whois.donuts.co","Domain not found."),
"christmas" => array("whois.uniregistry.net","is available for registration"),
"ci" => array("whois.nic.ci","not found"),
"cl" => array("whois.nic.cl",": no existe"),
"cleaning" => array("whois.donuts.co","Domain not found."),
"clothing" => array("whois.donuts.co","Domain not found."),
"club" => array("whois.nic.club","Not found:"),
"cn" => array("whois.cnnic.cn","no matching record."),
"co" => array("whois.nic.co","Not found:"),
"codes" => array("whois.donuts.co","Domain not found."),
"coffee" => array("whois.donuts.co","Domain not found."),
"college" => array("whois.centralnic.com","DOMAIN NOT FOUND"),
"cologne" => array("whois-fe1.pdt.cologne.tango.knipp.de","no matching objects found"),
"community" => array("whois.donuts.co","Domain not found."),
"company" => array("whois.donuts.co","Domain not found."),
"construction" => array("whois.donuts.co","Domain not found."),
"contractors" => array("whois.donuts.co","Domain not found."),
"cooking" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"cool" => array("whois.donuts.co","Domain not found."),
"coop" => array("whois.nic.coop","No domain records were found to match"),
"country" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"cruises" => array("whois.donuts.co","Domain not found."),
"cx" => array("whois.nic.cx","Domain Status: No Object Found"),
"cz" => array("whois.nic.cz","No entries found."),
"dating" => array("whois.donuts.co","Domain not found."),
"de" => array("whois.denic.de","Status: free"),
"democrat" => array("whois.unitedtld.com","Domain not found."),
"desi" => array("whois.ksregistry.net","not found..."),
"diamonds" => array("whois.donuts.co","Domain not found."),
"directory" => array("whois.donuts.co","Domain not found."),
"dk" => array("whois.dk-hostmaster.dk","No entries found for the selected source."),
"dm" => array("whois.nic.dm","not found..."),
"domains" => array("whois.donuts.co","Domain not found."),
"dz" => array("whois.nic.dz","NO OBJECT FOUND!"),
"ec" => array("whois.nic.ec","Status: Not Registered"),
"edu" => array("whois.educause.edu","No Match"),
"education" => array("whois.donuts.co","Domain not found."),
"ee" => array("whois.tld.ee","No entries found."),
"email" => array("whois.donuts.co","Domain not found."),
"engineering" => array("whois.donuts.co","Domain not found."),
"enterprises" => array("whois.donuts.co","Domain not found."),
"equipment" => array("whois.donuts.co","Domain not found."),
//"es" => array("whois.nic.es","MATCH"), // You need your IP to be whitelisted, read more: https://sede.red.gob.es/eRegistro/inicio.action
"estate" => array("whois.donuts.co","Domain not found."),
"eu" => array("whois.eu","Status: AVAILABLE"),
"eus" => array("whois.eus.coreregistry.net","no matching objects found"),
"events" => array("whois.donuts.co","Domain not found."),
"expert" => array("whois.donuts.co","Domain not found."),
"exposed" => array("whois.donuts.co","Domain not found."),
"farm" => array("whois.donuts.co","Domain not found."),
"feedback" => array("whois.centralnic.com","DOMAIN NOT FOUND"),
"fi" => array("whois.fi","Domain not found"),
"fish" => array("whois.donuts.co","Domain not found."),
"fishing" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"flights" => array("whois.donuts.co","Domain not found."),
"florist" => array("whois.donuts.co","Domain not found."),
"fo" => array("whois.nic.fo","No entries found."),
"foo" => array("domain-registry-whois.l.google.com","Domain not found"),
"foundation" => array("whois.donuts.co","Domain not found."),
"fr" => array("whois.nic.fr","No entries found"),
"frogans" => array("whois-frogans.nic.fr","Requested Domain cannot be found"),
"futbol" => array("whois.unitedtld.com","Domain not found."),
"ga" => array("whois.gal.coreregistry.net","no matching objects found"),
"gal" => array("whois.donuts.co","Domain not found."),
"gd" => array("whois.nic.gd","not found..."),
"gg" => array("whois.gg","Domain Status: No Object Found"),
"gi" => array("whois2.afilias-grs.net","NOT FOUND"),
"gift" => array("whois.uniregistry.net","is available for registration"),
"gl" => array("whois.nic.gl","Domain Status: No Object Found"),
"glass" => array("whois.donuts.co","Domain not found."),
"gop" => array("whois-cl01.mm-registry.com","Status: Not Registered"),
"gov" => array("whois.nic.gov","No match for"),
"graphics" => array("whois.donuts.co","Domain not found."),
"gripe" => array("whois.donuts.co","Domain not found."),
"gs" => array("whois.nic.gs","Domain Status: No Object Found"),
"guitars" => array("whois.uniregistry.net","is available for registration"),
"guru" => array("whois.donuts.co","Domain not found."),
"gy" => array("whois.registry.gy","Domain Status: No Object Found"),
"haus" => array("whois.unitedtld.com","Domain not found."),
"hk" => array("whois.hkirc.hk","The domain has not been registered."),
"hn" => array("whois.nic.hn","Domain Status: No Object Found"),
"holiday" => array("whois.donuts.co","Domain not found."),
"horse" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"house" => array("whois.donuts.co","Domain not found."),
"hr" => array("whois.dns.hr","ERROR: no entries found"),
"ht" => array("whois.nic.ht","Domain Status: No Object Found"),
"hu" => array("whois.nic.hu","No match"),
"id" => array("whois.pandi.or.id","DOMAIN NOT FOUND"),
"ie" => array("whois.domainregistry.ie","Not Registered"),
"il" => array("whois.isoc.org.il","No data was found to match the request criteria."),
"im" => array("whois.nic.im","was not found."),
"immobilien" => array("whois.unitedtld.com","Domain not found."),
"in" => array("whois.inregistry.net","NOT FOUND"),
"industries" => array("whois.donuts.co","Domain not found."),
"institute" => array("whois.donuts.co","Domain not found."),
"int" => array("whois.iana.org","This query returned 0 objects."),
"international" => array("whois.donuts.co","Domain not found."),
"iq" => array("whois.cmc.iq","Domain Status: No Object Found"),
"ir" => array("whois.nic.ir","No entries found in the selected"),
"is" => array("whois.isnic.is","No entries found for query"),
"it" => array("whois.nic.it","Status: AVAILABLE"),
"je" => array("whois.je","Domain Status: No Object Found"),
"jobs" => array("jobswhois.verisign-grs.com","No match for"),
"jp" => array("whois.jprs.jp","No match!!"),
"kaufen" => array("whois.unitedtld.com","Domain not found."),
"ke" => array("whois.kenic.or.ke","Status: Not Registered"),
"kg" => array("whois.domain.kg","Data not found. This domain is available for registration."),
"ki" => array("whois.nic.ki","Domain Status: No Object Found"),
"kitchen" => array("whois.donuts.co","Domain not found."),
"kiwi" => array("whois.dot-kiwi.com","Status: Not Registered"),
"koeln" => array("whois-fe1.pdt.koeln.tango.knipp.de","no matching objects found"),
"kr" => array("whois.kr","Above domain name is not registered to KRNIC."),
"kz" => array("whois.nic.kz","Nothing found for this query."),
"la" => array("whois.nic.la","DOMAIN NOT FOUND"),
"land" => array("whois.donuts.co","Domain not found."),
"lease" => array("whois.donuts.co","Domain not found."),
"li" => array("whois.nic.li","We do not have an entry in our database matching your query"),
"lighting" => array("whois.donuts.co","Domain not found."),
"limo" => array("whois.donuts.co","Domain not found."),
"link" => array("whois.uniregistry.net","is available for registration"),
"london" => array("whois-lon.mm-registry.com","Status: Not Registered"),
"lt" => array("whois.domreg.lt","Status: available"),
"lu" => array("whois.dns.lu","No such domain"),
"luxury" => array("whois.nic.luxury","No Data Found"),
"lv" => array("whois.nic.lv","Status: free"),
"ly" => array("whois.nic.ly","Not found"),
"ma" => array("whois.iam.net.ma","No Objects Found"),
"management" => array("whois.donuts.co","Domain not found."),
"mango" => array("whois.mango.coreregistry.net","no matching objects found"),
"marketing" => array("whois.donuts.co","Domain not found."),
"md" => array("whois.nic.md","No match for"),
"me" => array("whois.nic.me","NOT FOUND"),
"media" => array("whois.donuts.co","Domain not found."),
"menu" => array("whois.nic.menu","No Data Found"),
"mg" => array("whois.nic.mg","Domain Status: Available"),
"miami" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"mk" => array("whois.marnet.mk","no entries found"),
"ml" => array("whois.dot.ml","domain name not known"),
"mn" => array("whois.nic.mn","MATCH"), // not responding
"mo" => array("whois.monic.mo","No match for"),
"mobi" => array("whois.dotmobiregistry.net","NOT FOUND"),
"moda" => array("whois.unitedtld.com","Domain not found."),
"monash" => array("whois.nic.monash","No Data Found"),
"mp" => array("whois.nic.mp","MATCH"), // not responding
"ms" => array("whois.nic.ms","Domain Status: No Object Found"),
"mu" => array("whois.nic.mu","Domain Status: No Object Found"),
"museum" => array("whois.museum","NOT FOUND."),
"mx" => array("whois.mx","Object_Not_Found"),
"my" => array("whois.domainregistry.my","does not exist in database"),
"na" => array("whois.na-nic.com.na","Domain Status: No Object Found"),
"name" => array("whois.nic.name","No match for"),
"nc" => array("whois.nc","No entries found in the .nc database"),
"nf" => array("whois.nic.nf","Domain Status: No Object Found"),
"ng" => array("whois.nic.net.ng","Domain Status: Available"),
"ninja" => array("whois.unitedtld.com","Domain not found."),
"nl" => array("whois.domain-registry.nl","is free"),
"no" => array("whois.norid.no","% No match"),
"nu" => array("whois.iis.nu","not found."),
"nz" => array("whois.srs.net.nz","220 Available"),
"om" => array("whois.registry.om","No Data Found"),
"onl" => array("whois.afilias-srs.net","NOT FOUND"),
"paris" => array("whois-paris.nic.fr","Requested Domain cannot be found"),
"partners" => array("whois.donuts.co","Domain not found."),
"parts" => array("whois.donuts.co","Domain not found."),
"pe" => array("kero.yachay.pe","Status: Not Registered"),
"pf" => array("whois.registry.pf","Domain unknown"),
"photo" => array("whois.uniregistry.net","is available for registration"),
"photography" => array("whois.donuts.co","Domain not found."),
"photos" => array("whois.donuts.co","Domain not found."),
"pics" => array("whois.uniregistry.net","is available for registration"),
"pictures" => array("whois.donuts.co","Domain not found."),
"pl" => array("whois.dns.pl","No information available"),
"plumbing" => array("whois.donuts.co","Domain not found."),
"pm" => array("whois.nic.pm","No entries found"),
"post" => array("whois.dotpostregistry.net","NOT FOUND"),
"pr" => array("whois.nic.pr","is not registered."),
"pro" => array("whois.dotproregistry.net","NOT FOUND"),
"productions" => array("whois.donuts.co","Domain not found."),
"properties" => array("whois.donuts.co","Domain not found."),
"pt" => array("whois.dns.pt","no match"),
"pub" => array("whois.unitedtld.com","Domain not found."),
"pw" => array("whois.nic.pw","DOMAIN NOT FOUND"),
"qa" => array("whois.registry.qa","No Data Found"),
"quebec" => array("whois.quebec.rs.corenic.net","no matching objects found"),
"re" => array("whois.nic.re","No entries found"),
"recipes" => array("whois.donuts.co","Domain not found."),
"reisen" => array("whois.donuts.co","Domain not found."),
"rentals" => array("whois.donuts.co","Domain not found."),
"repair" => array("whois.donuts.co","Domain not found."),
"report" => array("whois.donuts.co","Domain not found."),
"rest" => array("whois.centralnic.com","DOMAIN NOT FOUND"),
"reviews" => array("whois.unitedtld.com","Domain not found."),
"rich" => array("whois.afilias-srs.net","NOT FOUND"),
"ro" => array("whois.rotld.ro","No entries found"),
"rocks" => array("whois.unitedtld.com","Domain not found."),
"rodeo" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"rs" => array("whois.rnids.rs","Domain is not registered"),
"ru" => array("whois.tcinet.ru","No entries found"),
"ruhr" => array("whois.nic.ruhr","no matching objects found"),
"sa" => array("whois.nic.net.sa","No Match for"),
"saarland" => array("whois.ksregistry.net","not found..."),
"sb" => array("whois.nic.net.sb","Domain Status: No Object Found"),
"sc" => array("whois2.afilias-grs.net","NOT FOUND"),
"se" => array("whois.iis.se","not found."),
"services" => array("whois.donuts.co","Domain not found."),
"sexy" => array("whois.uniregistry.net","is available for"),
"sg" => array("whois.sgnic.sg","Domain Not Found"),
"sh" => array("whois.nic.sh","is available for purchase"),
"shoes" => array("whois.donuts.co","Domain not found."),
"si" => array("whois.arnes.si","No entries found"),
"singles" => array("whois.donuts.co","Domain not found."),
"sk" => array("whois.sk-nic.sk","Not found."),
"sm" => array("whois.nic.sm","No entries found."),
"sn" => array("whois.nic.sn","NOT FOUND"),
"so" => array("whois.nic.so","DOMAIN NOT FOUND"),
"social" => array("whois.unitedtld.com","Domain not found."),
"solar" => array("whois.donuts.co","Domain not found."),
"solutions" => array("whois.donuts.co","Domain not found."),
"soy" => array("domain-registry-whois.l.google.com","Domain not found"),
"st" => array("whois.nic.st","No entries found"),
"su" => array("whois.tcinet.ru","No entries found"),
"supplies" => array("whois.donuts.co","Domain not found."),
"supply" => array("whois.donuts.co","Domain not found."),
"support" => array("whois.donuts.co","Domain not found."),
"sx" => array("whois.sx","Status: AVAILABLE"),
"sy" => array("whois.tld.sy","Domain Status: Available"),
"systems" => array("whois.donuts.co","Domain not found."),
"tattoo" => array("whois.uniregistry.net","is available for registration"),
"tc" => array("whois.meridiantld.net","Domain Status: No Object Found"),
"technology" => array("whois.donuts.co","Domain not found."),
"tel" => array("whois.nic.tel","Not found:"),
"tf" => array("whois.nic.tf","No entries found"),
"th" => array("whois.thnic.co.th","No match for"),
"tienda" => array("whois.donuts.co","Domain not found."),
"tips" => array("whois.donuts.co","Domain not found."),
"tk" => array("whois.dot.tk","Invalid query or domain name not known"),
"tl" => array("whois.nic.tl","Domain Status: No Object Found"),
"tm" => array("whois.nic.tm","is available for purchase"),
"tn" => array("whois.ati.tn","NO OBJECT FOUND!"),
"to" => array("whois.tonic.to","No match for"),
"today" => array("whois.donuts.co","Domain not found."),
"tools" => array("whois.donuts.co","Domain not found."),
"town" => array("whois.donuts.co","Domain not found."),
"toys" => array("whois.donuts.co","Domain not found."),
"tr" => array("whois.nic.tr","No match found for"),
"training" => array("whois.donuts.co","Domain not found."),
"travel" => array("whois.nic.travel","Not found:"),
"tv" => array("tvwhois.verisign-grs.com","No match for"),
"tw" => array("whois.twnic.net.tw","No Found"),
"tz" => array("whois.tznic.or.tz","No entries found."),
"ua" => array("whois.ua","No entries found for"),
"ug" => array("whois.co.ug","No entries found for the selected source(s)."),
"uk" => array("whois.nic.uk","This domain name has not been registered."),
"university" => array("whois.donuts.co","Domain not found."),
"us" => array("whois.nic.us","Not found"),
"uy" => array("whois.nic.org.uy","No match for"),
"black" => array("whois.afilias.net","NOT FOUND"),
"blue" => array("whois.afilias.net","NOT FOUND"),
"info" => array("whois.afilias.net","NOT FOUND"),
"kim" => array("whois.afilias.net","NOT FOUND"),
"pink" => array("whois.afilias.net","NOT FOUND"),
"red" => array("whois.afilias.net","NOT FOUND"),
"shiksha" => array("whois.afilias.net","NOT FOUND"),
"uz" => array("whois.cctld.uz","not found in database"),
"vacations" => array("whois.donuts.co","Domain not found."),
"vc" => array("whois2.afilias-grs.net","NOT FOUND"),
"ve" => array("whois.nic.ve","No match for"),
"vegas" => array("whois.afilias-srs.net","NOT FOUND"),
"ventures" => array("whois.donuts.co","Domain not found."),
"vg" => array("ccwhois.ksregistry.net","not found..."),
"viajes" => array("whois.donuts.co","Domain not found."),
"villas" => array("whois.donuts.co","Domain not found."),
"vision" => array("whois.donuts.co","Domain not found."),
"vodka" => array("whois-dub.mm-registry.com","Status: Not Registered"),
"voting" => array("whois.voting.tld-box.at","No match"),
"voyage" => array("whois.donuts.co","Domain not found."),
"vu" => array("vunic.vu","is not valid!"),
"wang" => array("whois.gtld.knet.cn","No match"),
"watch" => array("whois.donuts.co","Domain not found."),
"wed" => array("whois.nic.wed","Domain Status: No Object Found"),
"wf" => array("whois.nic.wf","No entries found in the AFNIC Database."),
"wien" => array("whois.nic.wien","No match"),
"wiki" => array("whois.nic.wiki","DOMAIN NOT FOUND"),
"works" => array("whois.donuts.co","Domain not found."),
"ws" => array("whois.website.ws","No match for"),
"xxx" => array("whois.nic.xxx","NOT FOUND"),
"xyz" => array("whois.nic.xyz","DOMAIN NOT FOUND"),
"yt" => array("whois.nic.yt","No entries found in the AFNIC Database."),
"ryukyu" => array("whois.nic.ryukyu", "DOMAIN NOT FOUND"),
"zm" => array("whois.nic.zm","Domain Status: No Object Found"),
"zone" => array( "whois.donuts.co","Domain not found."),
"scot" => array("whois.nic.scot","no matching objects found"),
"br" => array("whois.nic.br","No match for"),
"engineer" => array("whois.nic.engineer","Domain not found"),
"gifts" => array("whois.nic.gifts","Domain not found"),
"quebec" => array("whois.nic.quebec","no matching objects found"),
"restaurant" => array("whois.nic.restaurant","Domain not found"),
"sarl" => array("whois.nic.sarl","Domain not found"),
"click" => array("whois.nic.click","is available for registration"),
"host" => array("whois.nic.host","DOMAIN NOT FOUND"),
"hosting" => array("whois.nic.hosting","is available for registration"),
"trade" => array("whois.nic.trade","Not found"),
"career" => array("whois.nic.career|No match for"),
"diet" => array("whois.nic.diet","is available for registration"),
"help" => array("whois.nic.help","is available for registration"),
"jobs" => array("jobswhois.verisign-grs.com","No match for"),
"property" => array("whois.nic.property","is available for registration"),
"beer" => array("whois.nic.beer","Not Registered"),
"direct" => array("whois.nic.direct","Domain not found"),
"place" => array("whois.nic.place","Domain not found"),
"surf" => array("whois.nic.surf","Not Registered"),
"healthcare" => array("whois.donuts.co","Domain not found"),
"army" => array("whois.unitedtld.com","Domain not found"),
"navy" => array("whois.unitedtld.com","Domain not found"),
"airforce" => array("whois.unitedtld.com","Domain not found"),
"vet" => array("whois.unitedtld.com","Domain not found"),
"za" => array("whois.co.za","Available")
);


// gethostbyname returns the same string if it cant find the domain,
// we do a further check to see if it is a false positive
//if (gethostbyname($domain) == $domain) {
// get the TLD of the domain
$tld = $this->get_tld($domain);

// If an entry for the TLD exists in the whois array
if (isset($whois_arr[$tld][0])) {
// set the hostname for the whois server
$whois_server = $whois_arr[$tld][0];

// set the "domain not found" string
$bad_string = $whois_arr[$tld][1];
} else {
// TODO: REFACTOR THIS
// TLD is not in the whois array, die
//throw new Exception("WHOIS server not found for that TLD");
return '2';
}

$status = $this->checkDomainNameAvailabilty($domain,$whois_server,$bad_string);

return $status;
//} else {
// not available
// return FALSE;
//}

}


/**
* Extracts the TLD from a domain, supports URLS with "www." at the beginning.
*
*
* @param string $domain The domain that will get it's TLD extracted
* @return string The TLD for $domain
*/

public function get_tld ($domain) {
$split = explode('.', $domain);

if(count($split) === 0) {
throw new Exception('Invalid domain extension');

}
return end($split);
}

public function checkDomainNameAvailabilty($domain_name, $whois_server, $find_text){

// Open a socket connection to the whois server
$con = fsockopen($whois_server, 43);
if (!$con) return false;

// Send the requested domain name
fputs($con, $domain_name."\r\n");

// Read and store the server response
$response = " :";
while(!feof($con))
$response .= fgets($con,128);

// Close the connection
fclose($con);

// Check the Whois server response
if (strpos(strtolower($response), strtolower($find_text)))
return '1';
else
return '0';
}
}

?>

I also changed the API, here is a screenshot

View attachment 345

Appreciate the help!
Thanks for sharing. Please remember to wrap the code in BBCode, it makes it so much easier to read. You can do this within the editor and clicking the (...) select Code.
 
This is easier than it looks. @abemporat Try studying GET and POST methods to add to your html tag. In this case you would need a GET method added to the HTML tag right before the input area. In this case you would need your input to be submitted.

Here's an example.

HTML:
<form action="path/to/php/file.php" method="GET">
<label for="searchBar">Search for API</label><br>
  <input type="text" id="idForStyling" value="enter your search here"><br><br>
    <input type="submit" value="Submit">
</form>

GET methods are mainly for what your looking to do as POST methods are usually for logins or where sensitive information is entered in the form so no one can find the information the user submitted. Simply set the little HTML beauty up and add the path to your PHP file. If the PHP file is set up properly, you should have no problem getting this to work.

I hope that helps you :D

Here is more info on GET and POST on w3schools. Should study this and it will be a piece of cake -> https://www.w3schools.com/html/html_forms.asp
 
(Comment - As unfortunately, the commenting system has been removed due it not being used, and also for "ruining" the post-flow) As another way to learn about the GET and POST methods, I'd actually recommend checking out the official PHP documentation over at: https://www.php.net

Not trying to say that W3Schools is bad, but in my opinion, they aren't really good for languages like PHP or Python. I'd only say W3Schools is better for HTML, CSS, JS, and possibly jQuery but that's about it.
 
This is easier than it looks. @abemporat Try studying GET and POST methods to add to your html tag. In this case you would need a GET method added to the HTML tag right before the input area. In this case you would need your input to be submitted.

Here's an example.

HTML:
<form action="path/to/php/file.php" method="GET">
<label for="searchBar">Search for API</label><br>
  <input type="text" id="idForStyling" value="enter your search here"><br><br>
    <input type="submit" value="Submit">
</form>

GET methods are mainly for what your looking to do as POST methods are usually for logins or where sensitive information is entered in the form so no one can find the information the user submitted. Simply set the little HTML beauty up and add the path to your PHP file. If the PHP file is set up properly, you should have no problem getting this to work.

I hope that helps you :D

Here is more info on GET and POST on w3schools. Should study this and it will be a piece of cake -> https://www.w3schools.com/html/html_forms.asp
OK this is the html code for the search bar.

But, the .php file linked to the api... that is what is making me crazy, i need to make the php i attached before, to look for IMEI information on the API key i submitted, how do i change that?
 
Have you set up PHP on your machine in some method? You'll need some way of running PHP scripts, if you've got PHP set up already then for quick and dirty scripts I just use the built in web server. Alternatively you'll need to use something else (MAMP, XAMP - if they still exist?), Docker with PHP. Basically anything that will take your PHP file and actually run the code.

Assuming you have PHP installed, the code is actually right there for you on that page:

1585941285333.png

On the right hand side of that page you click the drop down menu to change the language.

This line:
CURLOPT_POSTFIELDS => "imei=355136052818864",

Is the one you'll want to replace with your input from your search form. I think as has been suggested, just use a GET request from the search.

In your PHP you'll do something like:

Code:
$imei = $_GET['imei'];

// add some validation to make sure you get a valid number (ie. check that its an integer)

// .. curl stuff
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://ismaelc-imei-info.p.rapidapi.com/checkimei",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "imei=$imei",
//... etc

Hopefully this will set you on the right path; I'm always reluctant to just give the answer away and rather send you down the right path.
 

Latest posts

Buy us a coffee!

Back
Top Bottom