Why won't my PHP work in HTML?
Posted: Wed May 03, 2006 2:46 pm
I have just changed my main page from index.php to index.html. In the process I had a bunch of stuff changed in the code to make it ready for the public domain, but now my embedded PHP code doesn't work.
I was under the impression that PHP could be integrated by simply using the <? ?> insertion tags in html documents. Here's an example of my page. Note that the <? session_start()?> doesn't work, and neither does the $_SESSION call in the signin box.
Any ideas?
I was under the impression that PHP could be integrated by simply using the <? ?> insertion tags in html documents. Here's an example of my page. Note that the <? session_start()?> doesn't work, and neither does the $_SESSION call in the signin box.
Code: Select all
<? session_start();?>
<html>
<head>
<title>The Page</title>
<meta http-equiv="Content-Type" content="text/html;">
.
.
.
<table ALIGN="CENTER" BORDER=0 id="text">
<form name="theForm" action="./sheets/getin.php" method="POST">
<TR><TD><h3>Sign In</h3></TD></TR>
<tr><td>Username:</td><td><input type="text" name="username" value="
<? if(!empty($_SESSION['username'])){
echo $_SESSION['username'];
}else echo "";
?>"></td></tr>
<tr><td>Password:</td><td><input type="password" name="password"></td></tr>
<tr><td><input type="submit" value="login" name="submit"></td></tr>
</form>
</table>