Web Analytics Made Easy -
StatCounter parse error - CodingForum

Announcement

Collapse
No announcement yet.

parse error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • parse error

    i get the following message when i run a function...

    Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in C:\AppServ\www\sjmsurveys.com\insulation\stats\function.legendCreator.php on line 7
    and the function is...

    PHP Code:
    function ageofcall($dateofcall)
    {

        
    $currentdate date('Y-m-d H:i:s');
        $
    1monthago date('Y-m-d H:i:s' ,mktime(9,0,0,date("m")-1,date("d"),date("Y")));
        $
    2monthago date('Y-m-d H:i:s' ,mktime(9,0,0,date("m")-1,date("d"),date("Y")));

        if((
    $dateofcall > $2monthago) && ($dateofcall <= $1monthago))
        {
        
            echo 
    "FF9900"//orange text
        
        
    }
        elseif((
    $dateofcall > $1monthago) && ($dateofcall <= $currentdate))
        {
        
            echo 
    "#00CC00"//green text
        
        
    }
        elseif(
    $dateofcall < $2monthago)
        {
        
            echo 
    "#FF0000"//red text
        
        
    }


    the function is to control the text colour on a stats page dependant on how old the lead is. up 1 month old is green, 1 - 2 months is orange and 2 + months is red.

    does any on know y i am getting this error?????

  • #2
    You can't name a variable $1monthago; a variable must begin with a letter or an underscore.

    Comment


    • #3
      nice 1 m8, i figured that out i couple of hours after i posted this but thanks alot for your advice.

      Comment

      Working...
      X