Fatal error: Cannot redeclare writetologfile()

Results 1 to 10 of 10
  1. #1
    Proficient Member Blue_Blast is offline
    MemberRank
    Feb 2009 Join Date
    GermanyLocation
    196Posts

    Fatal error: Cannot redeclare writetologfile()

    Hi Guys it's me again
    I use Final Revolution GunZ by DN as my Webpage and I want to upload a Clan Emblem, but everytime I want to upload one there is this error :

    Code:
    Fatal error: Cannot redeclare writetologfile() (previously declared in C:\AppServ\www\emblem\sec.php:3) in C:\AppServ\www\emblem\sec.php on line 27
    BTW here is my sec.php if this helps u:
    <?
    /////////////////////////////
    function writeToLogFile($msg)
    {
    // $today = date("M j G:i:s Y");
    $today = date("Y_m_d");
    $logfile = "../logs/".$today."_log_SQL INJECTIONS.txt";
    $dir = '';
    $saveLocation=$logfile;
    $fp = @fopen( $saveLocation,"r");
    $Data = @fread($fp, 800000);

    if (!$handle = @fopen($saveLocation, "w+b"))
    {
    echo "error";
    exit;
    }
    else
    {
    if(@fwrite($handle,"$msg\r\n SQL Injection detected\r\n$Data")===FALSE)
    {
    echo "geen error";
    exit;
    }
    @fclose($handle);
    }
    }
    /////////////////////////////
    function anti_injection($sql)
    {
    $sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
    $sql = trim($sql);
    $sql = strip_tags($sql);
    $sql = addslashes($sql);
    return $sql;
    }
    /////////////////////////////
    function valida($campos){
    foreach($campos as $c){
    if(empty($c)){
    echo ":: You have attempt to SQL inject. Log saved and sended to the webmaster ::<br />";
    $time = date("M j G:i:s Y");
    $ip = getenv('REMOTE_ADDR');
    $userAgent = getenv('HTTP_USER_AGENT');
    $referrer = getenv('HTTP_REFERER');
    $query = getenv('QUERY_STRING');
    $msg = "IP: " . $ip . " TIME: " . $time . " REFERRER: " . $referrer . " SEARCHSTRING: " . $query;
    writeToLogFile($msg);
    return false;
    }else{
    return true;
    }
    } }
    ?>
    And yes I used the Search Button, but the answers doesn't help me

    THNX 4 reading this and hope u can help me


  2. #2
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    You are declaring the function writetologfile() twice. You will need to find it on the file youre working now and delete it.

  3. #3
    Account Upgraded | Title Enabled! shortymant is offline
    MemberRank
    Nov 2008 Join Date
    606Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    Code:
    writeToLogFile($msg);
    return false;
    }else{
    return true;
    }
    } }
    ?>
    7th line from the bottom. Thanks CerealNP, couldn't find the right words. XD

  4. #4
    Account Upgraded | Title Enabled! Trilest is offline
    MemberRank
    Apr 2009 Join Date
    The NetherlandsLocation
    549Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    You've called the same function twice.

  5. #5
    Proficient Member Blue_Blast is offline
    MemberRank
    Feb 2009 Join Date
    GermanyLocation
    196Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    Mhh kay....
    First of all Thnx for ur answers
    But I'm a nub at PHP and this coding stuff, so I just want to know which parts I've to edit
    I know @ this part that shortymant posted I declared WriteToLogFile another time, but what I'll have to edit so that everything is working well ??

    Code:
    writeToLogFile($msg);
    return false;
    }else{
    return true;
    }
    } }
    ?>

  6. #6
    Proficient Member Blue_Blast is offline
    MemberRank
    Feb 2009 Join Date
    GermanyLocation
    196Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    I found a solution for my Prob
    I downloaded rotanas Clan Emblem Uploader Script and changed some things in the PHP's of DN and now it's all working fine

    /Request Closed

  7. #7
    Account Upgraded | Title Enabled! 00niels00 is offline
    MemberRank
    Sep 2008 Join Date
    The NetherlandsLocation
    1,041Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    But 1 problem? Final Revolution website. You don't may use it. They uses herogamerz script they are made by lambda and emisand.

    Lambda doesn't care about the files any more.
    But still emisand don't want that we use it.

  8. #8
    Proficient Member Blue_Blast is offline
    MemberRank
    Feb 2009 Join Date
    GermanyLocation
    196Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    Yeah i dunno that Sry again Emisand and Lambda

  9. #9
    Account Upgraded | Title Enabled! shortymant is offline
    MemberRank
    Nov 2008 Join Date
    606Posts

    Re: Fatal error: Cannot redeclare writetologfile()

    What? ~DN used Lambda's scripts in his website?
    I'm getting rid of that website. :P

  10. #10

    Re: Fatal error: Cannot redeclare writetologfile()

    Delete the 2nd code of writetologfile() in the php file. (not the functions)

    Don't ask me further please.



Advertisement