2009-08-03 46 views
2

我使用這個PHP腳本致命錯誤:無法實例不存在的類:的SimpleXMLElement

$error = false; 
if(isset($_POST['login'])){ 
    $username = preg_replace('/[^A-Za-z]/', '', $_POST['username']); 
    $password = md5($_POST['password']); 
    if(file_exists('users/' .$username . '.xml')){ 
     $xml = new SimpleXMLElement('users/' .$username . '.xml', 0, true); 
     if($password == $xml->password){ 
      session_start(); 
      $_SESSION['username'] = $username; 
      header('Location: agis-employees.html'); 
      die; 
     } 
    } 
    $error = true; 
} 

我結束了與此錯誤

Fatal error: Cannot instantiate non-existent class: simplexmlelement in /home/virtual/site250/fst/var/www/html/employeeportal/index.php on line 7

回答

相關問題