tags:

views:

396

answers:

2

I'm using this php script

$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;
}

And I end up with this error

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

+4  A: 

This most likely means that the SimpleXML extension is not enabled/present in your PHP installation. You can verify this by executing phpinfo() and looking for 'SimpleXML'. See:

http://www.php.net/manual/en/simplexml.installation.php http://www.php.net/manual/en/book.simplexml.php

karim79
A: 

I have same problem.

When i Run my file using URL from borwser, I get it working well. But when I sert a Cron Job using directory sturcture. It gives me error "Fatal error: Cannot instantiate non-existent class: simplexmlelement "

If you have answer for that, pls send it to me.