Hi,

I have write a domain control function in php, the php function will working fine.
I have create a simpel form with 2 textboxes and 1 button, i will put in this fields a 
domainname and the extention like   yahoo     com
if i click on the button, then we want to validate the domainname and the extention
This will not working

<?php
function controle($Domainname, $extention)
    if ($extention =="com") {    
    $server = "whois.internic.net";
    $query = $Domainname . "." . $extention;
    $data = whois_request($server, $query);
    if(strstr($data, "No match for")) {
      return "ok"
    } else {
      return "notok"
    }
    }
?>

<script>
function controledomainname(f)
  {
    if (controle(window.document.form1.domainname.value, 
window.document.form1.extention.value) = "notok")
        {
        alert("your domainname allready exist")
         }
  }
</script>

<form name="form1">
<input TYPE="text" NAME="domainname" size="20" >
<input TYPE="text" NAME="extention" size="20">
<input type="button" value="validate" onClick="controledomainname()">
</Form>

Best regards,
    Manu

Reply via email to