Help with a Parse Error, please......

Discussion in 'PHP' started by chrisj, Jul 14, 2007.

  1. #1
    Can you help me remedy this error, please? thank you.

    Parse error: syntax error, unexpected T_IF in /home/public_html/mms/classes/account.php on line 871

    
    function get_account_menu() {
           	 $html = "";
           	  if($this->check_login() == false) { 
           	  	$html = " ";
           	  } else {
           	  	
           	  	$account_id = $this->get_current_account_id();
           	  	$acount_type_id = $this->get_account_type_id($account_id);
               if ($account_type_id  == 1) { 
               $link= 'page1.php'
     
              if ($account_type_id  == 2 ) { 
              $link= 'page2.php'
              } 
    
           	   $content = new content_pages($this->system);
           	  	$pages_list = $content->get_account_pages_list($acount_type_id);
           	  	 
           	  	$html = $this->system->template->compile_template("account_menu.htm",get_defined_vars());	
           	  }
           	  return $html;
           } 
          
    Code (markup):
     
    chrisj, Jul 14, 2007 IP
  2. Nefarious

    Nefarious Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Without knowing the exact line that gives the error:

    This doesn't look right:
    
               if ($account_type_id  == 1) { 
               $link= 'page1.php'
     
              if ($account_type_id  == 2 ) { 
              $link= 'page2.php'
              }
    
    Code (markup):
    Is it suppose to be 2 separate if statements? The first if statement is not closed and is missing a semicolon after "$link= 'page1.php'"

    
    if ($account_type_id  == 1) { 
    	$link= 'page1.php';
    }
    elseif ($account_type_id  == 2 ) { 
    	$link= 'page2.php';
    }
    
    Code (markup):
     
    Nefarious, Jul 14, 2007 IP
  3. Bishop81

    Bishop81 Peon

    Messages:
    757
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I agree, this should be what you need to do to fix it.
     
    Bishop81, Jul 14, 2007 IP
  4. chrisj

    chrisj Well-Known Member

    Messages:
    606
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #4
    thank you......................................
     
    chrisj, Jul 15, 2007 IP