Jump to content

Search the Community

Showing results for tags 'dns_get_record'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. My first question: I have a message like this: notice: undefined offset 0 I use an input form to check with dns_get_record and DNS_MX whether the domain of an email exists. I can check the emails if the domain does exist, but a wrong domain like: mail@verynonexistingdomain.com throws in the notice undefined offset 0 so does an empty input. <html> <center> <br> email input :<br> <form action="#" method = "post"> <input type ="text" name ="mail"> <br> <input type="submit" name = "click" value ="zend"> </form> <?php $domain =''; $data =''; var_dump($_POST['click']); var_dump($_POST['mail']); if (isset($_POST['mail'])) { echo $_POST['mail']; $input = $_POST['mail']; } // // function check_address($input){ list($user, $domain) = explode('@', $input); $data= dns_get_record($domain, DNS_MX); if($data[0]['host']==$domain&&!empty($data[0]['target'])) { return $data[0]['target']; } else { }} echo check_address($input); Echo '<br><br>'; echo $input . " : " ; if(check_address($input) ) { echo('<br>This MX records exists; I will accept this email as valid.<br> '); } else { echo('<br>No MX record exists; Invalid email.<br>'); } echo '</center>'; ?> </html> I had it working without the form part so with a constant variable, but when I added the form it threw the error. I tried several options, but cant find the logic behind executing a good input without throwing an error and a bad domain giving this notice. Anyone any idea?
×
×
  • Create New...