Accueil > > > WHOIS RECHERCHE DE NOM DE DOMAINE
WHOIS RECHERCHE DE NOM DE DOMAINE
Information sur la source
Description
Modification d'un code tiré d'ici http://www.phpcs.com/code.aspx?ID=12806 mais on retrouve le même un peu partout sur le net. Aprés plein de test, je me suis aperçu qu'il fonctionnait pas complètement donc j'ai modifié un peu le code. Dsl, mais je n'est mis que les .com, .fr et .net car c les seuls dont j'ai besoin et vu que les autres du code précédent étaient pas forcément bien configuré, me suis pas pris la tête à faire un truc qui m'aurais servis à rien. De toute façon, si vous voulez en ajouter, suffit d'ajouter un bloc de ce type : if($endfix=='.com' || $endfix=='.net'){ $WhoIsServer="whois.crsnic.net "; $nb1 = 0; $nb2 = 8; $nb3 = 0; $nb4 = 13; $txt1 = "No match"; $txt2 = "Whois Server:"; } Bien sûr en cherchant le serveur approprié et le texte à en ressortir
Source
- <?
- header("Cache-Control: no-cache, must-revalidate");
- header("Pragma: no-cache");
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html>
- <head>
- <title>Nom de domaine</title>
- <?
- if (isset($_POST['submit'])){
- $endfix = $_POST['endfix'];
- $domainname = $_POST['domainname'];
-
- if($endfix=='.com' || $endfix=='.net'){
- $WhoIsServer="whois.crsnic.net";
- $nb1 = 0;
- $nb2 = 8;
- $nb3 = 0;
- $nb4 = 13;
- $txt1 = "No match";
- $txt2 = "Whois Server:";
- }
- else if($endfix=='.fr'){
- $WhoIsServer="whois.ripe.net";
- $nb1 = 3;
- $nb2 = 16;
- $nb3 = 0;
- $nb4 = 7;
- $txt1 = "No entries found";
- $txt2 = "domain:";
- }
-
- $domain=($domainname."".$endfix."");
-
- $fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
- set_socket_blocking($fp,0);
- fputs($fp, "$domain\n");
- while (!feof($fp)) {
- $result = trim(fgets($fp, 2048));
-
- if (trim(substr($result ,$nb1, $nb2)) == $txt1){
- echo "<table border=1 width=640 align=center><tr>";
- echo "<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>";
- }
- else if (substr($result ,$nb3, $nb4) == $txt2){
- echo "<table border=1 width=640 align=center><tr>";
- echo "<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>";
- echo "<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a> </b></font><br><br></td></tr></table><br><br><br><br><br>";
- }
- }
- fclose($fp);
- }
- else{
- $actio = $_GET['actio'];
- $WhoIsServer = $_GET['WhoIsServer'];
- $domain = $_GET['domain'];
- }
-
- function showtime($domain, $WhoIsServer) {
- if ((empty($domain) == false) && (empty($WhoIsServer) == false)) {
- $fps = fsockopen ("$WhoIsServer", 43, $errno, $errstr)
- or die(printf("Probleme avec le serveur Whois.\n"));
- set_socket_blocking($fps, 0);
- fputs($fps, "$domain\n");
- echo "<table border=1 width=640 align=center><tr><td><PRE>";
- while (!feof($fps)) {
- $result = fgets($fps, 2048);
- echo "$result";
- }
- echo "</td></tr></table></PRE>";
- fclose($fps);
- }
- else echo("Impossible d'affiche la date.\n");
-
- }
-
- if($actio) {
- switch ($actio) {
- case show:
- showtime($domain, $WhoIsServer);
- break;
- default: echo ("Probleme dans Switch!");
- break;
- }
-
-
- }
- ?>
- </head>
- <body>
- <table border="0" width="640" align=center>
- <tr>
- <td width="130" valign="top" align="left"><font face="Arial" size="2"><b>Verification de nom de domaine:</b></font></td>
- <td width="283" valign="top" align="left"><form action="domaine.php" method="POST"><font face="Verdana" size="2"><b>www. <input type="text" name="domainname" size="17"> <select name="endfix" size="1">
- <option name="com" value=".com">.com
- <option name="net" value=".net">.net
- <option name="org" value=".org">.org
- <option name="fr" value=".fr">.fr
- <option name="de" value=".de">.de
- <option name="ac" value=".ac">.ac
- <option name="at" value=".at">.at
- <option name="be" value=".be">.be
- <option name="ch" value=".ch">.ch
- <option name="cz" value=".cz">.cz
- <option name="dk" value=".dk">.dk
- <option name="eu.org" value=".eu.org">.eu.org
- <option name="it" value=".it">.it
- <option name="is" value=".is">.is
- <option name="hu" value=".hu">.hu
- <option name="li" value=".li">.li
- <option name="lt" value=".lt">.lt
- <option name="lu" value=".lu">.lu
- <option name="no" value=".no">.no
- <option name="sk" value=".sk">.sk
- </select></b></font>
- <td width="88" valign="top" align="left"><font face="Arial" size="2"><b><input type="submit" name="submit" value="Verifier"></b></font></td>
- <td width="121" valign="top" align="left"><font face="Arial" size="2"><b><input type="reset" value="Effacer"></b></font></td></form>
- </tr>
- </table>
- </body>
- </html>
<?
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Nom de domaine</title>
<?
if (isset($_POST['submit'])){
$endfix = $_POST['endfix'];
$domainname = $_POST['domainname'];
if($endfix=='.com' || $endfix=='.net'){
$WhoIsServer="whois.crsnic.net";
$nb1 = 0;
$nb2 = 8;
$nb3 = 0;
$nb4 = 13;
$txt1 = "No match";
$txt2 = "Whois Server:";
}
else if($endfix=='.fr'){
$WhoIsServer="whois.ripe.net";
$nb1 = 3;
$nb2 = 16;
$nb3 = 0;
$nb4 = 7;
$txt1 = "No entries found";
$txt2 = "domain:";
}
$domain=($domainname."".$endfix."");
$fp = fsockopen ("$WhoIsServer", 43, $errnr, $errstr);
set_socket_blocking($fp,0);
fputs($fp, "$domain\n");
while (!feof($fp)) {
$result = trim(fgets($fp, 2048));
if (trim(substr($result ,$nb1, $nb2)) == $txt1){
echo "<table border=1 width=640 align=center><tr>";
echo "<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain est libre!</b></font></td></tr></table><br><br><br><br><br>";
}
else if (substr($result ,$nb3, $nb4) == $txt2){
echo "<table border=1 width=640 align=center><tr>";
echo "<td><font face='arial' size='2' color='#4E566B'><b>Le nom de domaine $domain n est pas libre</b></font><br><br>";
echo "<font face='arial' size='2' color='#4E566B'><b>Voulez vous avoir des information a propos de ce domaine? <a href='$PHP_SELF?actio=show&WhoIsServer=$WhoIsServer&domain=$domain' target='_self'>Oui</a> / <a href='#' target='_self'>Non</a> </b></font><br><br></td></tr></table><br><br><br><br><br>";
}
}
fclose($fp);
}
else{
$actio = $_GET['actio'];
$WhoIsServer = $_GET['WhoIsServer'];
$domain = $_GET['domain'];
}
function showtime($domain, $WhoIsServer) {
if ((empty($domain) == false) && (empty($WhoIsServer) == false)) {
$fps = fsockopen ("$WhoIsServer", 43, $errno, $errstr)
or die(printf("Probleme avec le serveur Whois.\n"));
set_socket_blocking($fps, 0);
fputs($fps, "$domain\n");
echo "<table border=1 width=640 align=center><tr><td><PRE>";
while (!feof($fps)) {
$result = fgets($fps, 2048);
echo "$result";
}
echo "</td></tr></table></PRE>";
fclose($fps);
}
else echo("Impossible d'affiche la date.\n");
}
if($actio) {
switch ($actio) {
case show:
showtime($domain, $WhoIsServer);
break;
default: echo ("Probleme dans Switch!");
break;
}
}
?>
</head>
<body>
<table border="0" width="640" align=center>
<tr>
<td width="130" valign="top" align="left"><font face="Arial" size="2"><b>Verification de nom de domaine:</b></font></td>
<td width="283" valign="top" align="left"><form action="domaine.php" method="POST"><font face="Verdana" size="2"><b>www. <input type="text" name="domainname" size="17"> <select name="endfix" size="1">
<option name="com" value=".com">.com
<option name="net" value=".net">.net
<option name="org" value=".org">.org
<option name="fr" value=".fr">.fr
<option name="de" value=".de">.de
<option name="ac" value=".ac">.ac
<option name="at" value=".at">.at
<option name="be" value=".be">.be
<option name="ch" value=".ch">.ch
<option name="cz" value=".cz">.cz
<option name="dk" value=".dk">.dk
<option name="eu.org" value=".eu.org">.eu.org
<option name="it" value=".it">.it
<option name="is" value=".is">.is
<option name="hu" value=".hu">.hu
<option name="li" value=".li">.li
<option name="lt" value=".lt">.lt
<option name="lu" value=".lu">.lu
<option name="no" value=".no">.no
<option name="sk" value=".sk">.sk
</select></b></font>
<td width="88" valign="top" align="left"><font face="Arial" size="2"><b><input type="submit" name="submit" value="Verifier"></b></font></td>
<td width="121" valign="top" align="left"><font face="Arial" size="2"><b><input type="reset" value="Effacer"></b></font></td></form>
</tr>
</table>
</body>
</html>
Conclusion
Si vous avez des questions vous pouvez y aller!
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
RE : IMPORT CSVRE : IMPORT CSV par ykhider
Cliquez pour lire la suite par ykhider RE : HTML VERS PDFRE : HTML VERS PDF par abdennassir2
Cliquez pour lire la suite par abdennassir2
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|