SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast hawkshango's Avatar
    Join Date
    Jan 2005
    Location
    New York
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Missing argument 3 ??? What does it mean.

    I am getting this :
    Warning
    : Missing argument 3 for mycheckdnsrr() in /cregresults3.php on line 19

    This is what I have
    PHP Code:
     // Line 19 starts at the function line. 
        
    function myCheckDNSRR($sEmail$mailDomain, &$oStatus)
        {
        
    // take a given email address and split it into the username and domain.
        
    list($sEmail$mailDomain) = split("@"$sEmail);
        
        if (
    checkdnsrr($mailDomain"MX")) {
         
    // this is a valid email domain!
        
    $oStatus->bValid true;
        }
        else {
         
    // this email domain doesn't exist! 
        
    $oStatus->bValid false;
        }
        } 
    Now what am I missing or not doing? I am a newbie to PHP and so far I have learned enough to be dangerous but the purpose of this checking email is keeping email valid when people register for membership.

    Can some one please point out what I am not seeing?
    Thanks
    If you can imagine it, I can design it!
    The Pariah Press


  2. #2
    SitePoint Enthusiast webchick's Avatar
    Join Date
    Jun 2004
    Location
    in front of a computer
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Erm. Well. It means you're missing argument #3 (or more specifically, you're calling a function that's expecting you to pass it three things, and you're only passing it two)

    The function is declared as:
    PHP Code:
    function myCheckDNSRR($sEmail$mailDomain, &$oStatus
    but you're calling it with only two arguments:

    PHP Code:
    if (checkdnsrr($mailDomain"MX")) { 
    My guess is you want to change that line to:

    PHP Code:
    if (checkdnsrr($sEmail$mailDomain"MX")) { 
    <?$a='496620796f752063616e2072656164207468697320796f7527726520'.
    '616c6d6f7374206173206269672061206765656b206173204920616d203b29'
    ;$b=explode("\n",chunk_split($a,2));$c='';for($i=0;$i<count($b)
    -1;$i++){$c.=chr(base_convert($b[$i],16,10));}echo nl2br($c);?>

  3. #3
    SitePoint Enthusiast hawkshango's Avatar
    Join Date
    Jan 2005
    Location
    New York
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question One more time

    Quote Originally Posted by webchick
    Erm. Well. It means you're missing argument #3 (or more specifically, you're calling a function that's expecting you to pass it three things, and you're only passing it two)

    The function is declared as:
    PHP Code:
      function myCheckDNSRR($sEmail$mailDomain, &$oStatus
    but you're calling it with only two arguments:

    PHP Code:
      if (checkdnsrr($mailDomain"MX")) { 
    My guess is you want to change that line to:

    PHP Code:
      if (checkdnsrr($sEmail$mailDomain"MX")) { 
    Well, I added the third variable to (checkdnsrr) and got this:

    Warning: Missing argument 3 for mycheckdnsrr() in /cregresults3.php on line 19

    Warning: Wrong parameter count for checkdnsrr() in /cregresults3.php on line 24

    So I removed the offending parameter count($sEmail) and the second problem went away...
    I read the tutorial on verifying email address here on SitePoint but I wasn't too sure I got it down right. Maybe I am missing some key elements or formatting the function in the wrong way?

    By the way, what is the syntax for writing a split variable from like email?
    you have the user name and the email domain. 1 item...
    Did I correctly use the list () = split statement correctly? If not, how do I write it correctly and assign the variable $mailDomain?

    Thanks for the answering me?
    If you can imagine it, I can design it!
    The Pariah Press


  4. #4
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It does not make sense that you would get this error on a line dealing with function definition. Are you sure you are looking at the correct line of the correct file where this is being called?
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  5. #5
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read the error message... It's telling you that somewhere you're calling mycheckdnsrr() with the wrong number of parameters (I think webchick pointed to the wrong place). It's also saying that you've given the wrong number of parameters to checkdnsrr (because of what webchick said). Find out where you're calling mycheckdnsrr.

    Can I ask why you thought this was advanced PHP?

  6. #6
    SitePoint Enthusiast hawkshango's Avatar
    Join Date
    Jan 2005
    Location
    New York
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by sweatje
    It does not make sense that you would get this error on a line dealing with function definition. Are you sure you are looking at the correct line of the correct file where this is being called?
    Yes I am and the line in question starts with the function declaration.

    the 3 varibles that are declared are $sEmail, $mailDomain and &$oStatus, the last being a reference to another include file with the classes.

    This is the whole top function header of the cregresult3.php :

    PHP Code:
       
       
    function DomainCheck($sEmail, &$oStatus)
       {
    // email domain belong to these free email
       
    if   (preg_match("/freeemail\.com|yahoo\.com|hotmail\.|netaddress\.com|mail\.
       com|gmx\.de/i"
    $sEmail))
       {
       
    $oStatus->bValid false;
       }
       else
       {
       
    $oStatus->bValid true;
       }
       }
       function 
    myCheckDNSRR( &$sEmail$mailDomain, &$oStatus)
       {
       
    // take a given email address and split it into the username and domain.
       
    list($sEmail$mailDomain) = split("@"$sEmail);
       
    // is this correct for splitting up an email address to make it into one variable? 
       
       
    if (checkdnsrr($mailDomain"MX")) {
        
    // this is a valid email domain!
       
    $oStatus->bValid true;
       }
       else {
        
    // this email domain doesn't exist! 
       
    $oStatus->bValid false;
       }
       } 
    I hope this is a bit clearer now... The variables are passed over from the form page via the form action="" Validation is done in an included file with custom function being done in the result page itself. It works with no problem if the results are invalid or false but if true, then the resultant error warning.
    Thanks for your help.
    If you can imagine it, I can design it!
    The Pariah Press


  7. #7
    SitePoint Enthusiast hawkshango's Avatar
    Join Date
    Jan 2005
    Location
    New York
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tanus
    Read the error message... It's telling you that somewhere you're calling mycheckdnsrr() with the wrong number of parameters (I think webchick pointed to the wrong place). It's also saying that you've given the wrong number of parameters to checkdnsrr (because of what webchick said). Find out where you're calling mycheckdnsrr.

    Can I ask why you thought this was advanced PHP?
    Ok.. so this isn't advanced PHP???? but like I would like to know where you are referring to? I am a newbie... to me all this stuff is like advanced to me. So I read the error msg. So where do I look to find out where I am calling mycheckdnsrr, huh?

    Check out the first post, huh???
    If you can imagine it, I can design it!
    The Pariah Press


  8. #8
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's a standard php forum which is just above this one.

    The error: Warning: Missing argument 3 for mycheckdnsrr() in /cregresults3.php on line 19

    Okay, so it says you're missing argument 3 when you call mycheckdnsrr. Can you post the code that is actually calling the function? So far you've only posted the function you've coded, not where you're calling it from.

    So where do I look to find out where I am calling mycheckdnsrr, huh?
    I don't know. Is this your code? If not, have you got a 'find in files...' function in your text editor? That'll help...

  9. #9
    SitePoint Addict toggg's Avatar
    Join Date
    Jan 2005
    Location
    Auvergne/France
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi
    You define
    PHP Code:
    myCheckDNSRR() 
    and you call
    PHP Code:
    checkdnsrr() 
    ????
    +
    bertrand Gugger toggg.com linux, PHP, Auvergne/France open source

  10. #10
    SitePoint Enthusiast hawkshango's Avatar
    Join Date
    Jan 2005
    Location
    New York
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for trying to help me, everybody but I finally solved the dilemna. Seems that of the 3 variables declared, $mailDomain, need not to be declared. When I took it out, the warning went away. I got to thank an external expert for his help (and did).
    If you can imagine it, I can design it!
    The Pariah Press



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •