Beginners - PHP question
I am having trouble getting some login content (created in php) to show in my HTML. I have included it inside a table, but I'm not sure if this is right.
<table width="764" height="97" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td width="248"></td>
<td width="100%"></td>
<td>
<!--#include file="login/loginform.inc.php" -->
</td>
The php file is pretty simple:
<html>
<head>
<title>Login Form</title>
</head>
<body>
<?php
$Email = $_POST ["Email "];
$Password = $_POST开发者_如何学JAVA ["Password"];
if (Email == "admin" && $Password == "admin" )
{
echo "Logged In";}
?>
<form name="form1" method="post" action="">
<p>Email:
<label for="Email"></label>
<input type="text" name="Email" id="Email">
</p>
<p>Password:
<label for="Password"></label>
<input type="text" name="Password" id="Password">
</p>
<p>
<input type="submit" name="Login" id="Login" value="Login">
</p>
</form>
</body>
</html>
if (Email == "admin" && $Password == "admin" )
I think you meant:
if ($Email == "admin" && $Password == "admin" )
Little confused with what you're trying to do. But maybe replace:
<!--#include file="login/loginform.inc.php" -->
With everything you had between <?php
and ?>
, including the ? tags
You might first remove all the HTML from your login_form php file, as the file is already included in a HTML document.
And "if (Email == ..." should be "if ($Email == ..."
精彩评论