Help with error

Discussion in 'PHP' started by Decipher442, Dec 20, 2010.

  1. #1
    Just finished up converting this site from coldfusion to php script and I get this error..

    Fatal error: Cannot redeclare getmicrotime() (previously declared in /home/computer/public_html/includes/getvars.php:13) in /home/computer/public_html/includes/getvars.php on line 15
    Code (markup):
    Could it be because I didn't set the permissions on the file correctly?
     
    Last edited: Dec 20, 2010
    Decipher442, Dec 20, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    From the error it looks like you calling getmicrotime() on lines

    getvars.php:13 & getvars.php:15

    Did you duplicate a code there ?
     
    MyVodaFone, Dec 20, 2010 IP
  3. Decipher442

    Decipher442 Well-Known Member

    Messages:
    1,299
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    140
    #3
    nope, script came like coded as is.

    This is the code in the file..

    function getmicrotime(){
        list($usec, $sec) = explode(" ",microtime());
        return ((float)$usec + (float)$sec);
        }
    Code (markup):
     
    Decipher442, Dec 20, 2010 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    Hmm strange error... anyway

    I'm just guessing but this looks like it just a page load time script and you'll probable find this getmicrotime() in a footer file, if I was yourself, I would just take it out (from the footer file) as it serves no real purpose.
     
    MyVodaFone, Dec 20, 2010 IP