## Quick Fixing need, PHP experts Please help :)

Discussion in 'PHP' started by me4you, Jun 3, 2008.

  1. #1
    Hi DP's

    I brought a site there is some error Please help me to fix it.

    http://tinyurl.com/4575lq

    Warning: checkdnsrr() [function.checkdnsrr]: Host and type cannot be empty in /home/sendkiss/public_html/Include/mail.inc on line 8


    and


    http://tinyurl.com/3ll2lw

    whats are the Warning: on top also the chaptha code is not working :mad:


    Please help me OUT !
     
    me4you, Jun 3, 2008 IP
  2. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Apparently, you use checkdnsrr(), but do not pass any arguments to it (or the variables that you pass are undefined).

    The warnings you get are from division by zero. Somewhere in the code divide a number by 0, which is not possible. Take a good look trough all the divisions you make in the code and you should find it. This could also be caused by a undefined variable.

    Hope that helps :)
     
    xlcho, Jun 3, 2008 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    My guess would be register_globals is off, and you're running php5 and the code was written on php4 which had register_globals on by default ...

    Before any code is executed or variables referenced ... you might try ...

    
    extract( $_POST );
    extract( $_GET );
    
    PHP:
    This will allow _POST and _GET members to be used in the global scope and may be enough to fix it ...
     
    krakjoe, Jun 3, 2008 IP
    me4you likes this.
  4. me4you

    me4you Well-Known Member

    Messages:
    1,989
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    155
    #4
    now using php4 1 done done !!!


    what about the warning

    Warning: Division by zero in /home/sendkiss/public_html/Include/crypt.inc on line 9

    File crypt.inc

     
    me4you, Jun 4, 2008 IP
  5. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #5
    
    <?php
    $key = '1nand0nor';
    function encrypt($string)
    {
    global $key ;
    $result = '';
    for($i=0; $i<strlen($string); $i++)
    {
    $char = substr($string, $i, 1);
    $keychar = substr($key, ($i % strlen($key))-1, 1);
    $char = chr(ord($char)+ord($keychar));
    $result.=$char;
    }
    return base64_encode($result);
    }
    
    function decrypt($string)
    {
    global $key ;
    $result = '';
    $string = base64_decode($string);
    
    for($i=0; $i<strlen($string); $i++)
    {
    $char = substr($string, $i, 1);
    $keychar = substr($key, ($i % strlen($key))-1, 1);
    $char = chr(ord($char)-ord($keychar));
    $result.=$char;
    }
    return $result;
    }
    ?>
    
    PHP:
     
    krakjoe, Jun 4, 2008 IP
  6. me4you

    me4you Well-Known Member

    Messages:
    1,989
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    155
    #6
    <?php
    $key = '1nand0nor'; what should i type there :D
    function encrypt($string)

    ....

    also the chaptha code why not working, the code is bellow, also why they use crypt.inc on that file :) I wish time time done ! :)





    Chapcha
     
    me4you, Jun 4, 2008 IP