I have a little piece of php code in an html file but when i browse to the file it displays some part of the code instead of executing. below is the code
<?php
session_start();
if (!$_SESSION["valid_user"])
{
// User not logged in, redirect to login page
Header('Location: login.html?returnurl=' . urlencode($_SERVER['REQUEST_URI']));
}
echo "<p><a href=\"logout.html\">logout " . $_SESSION["valid_user"] . "</a></p>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
here is the content of .htaccess file
`AddHandler application/x-httpd-php .html .htm`
php version: 5.4.4 server: apache
It would be really helpful if someone can help