Hey guys, I'm new and to PHP. All I know is from a few online tutorials. Right now I'm trying to implement a member's area with client log in / registration on my site.
I'm getting this error message. I can't figure out why. advice please?
Parse error: syntax error, unexpected '<' in /home/content/j/m/a/jmarie19/html/MembersArea/login.php on line 9
Here is the file it is referencing...
<?php
include("conf.inc.php"); // Includes the db and form info.
session_start(); // Starts the session.
if ($_SESSION['logged'] == 1) { // User is already logged in.
header("Location: index.php"); // Goes to main page.
exit(); // Stops the rest of the script.
} else {
if (!isset($_POST['submit'])) { // The form has not been submitted.
<form action="login.php" method="POST">
<table>
<tbody>
<tr>
<td colspan="2">Login:</td>
</tr>
<tr>
<td width="50%">Username:</td>
<td width="50%"><input name="username" size="18" type="text" /></td>
</tr>
<tr>
<td width="50%">Password:</td>
<td width="50%"><input name="password" size="18" type="text" /></td>
</tr>
<tr>
<td colspan="2"><input name="submit" type="submit" value="submit" /></td>
</tr>
</tbody>
</table>
</form>login;
} else {
$username = form($_POST['username']);
$password = md5($_POST['password']); // Encrypts the password.
$q = mysql_query("SELECT * FROM `users` WHERE username = '$username' AND password = '$password'") or die (mysql_error()); // mySQL query
$r = mysql_num_rows($q); // Checks to see if anything is in the db.
if ($r == 1) { // There is something in the db. The username/password match up.
$_SESSION['logged'] = 1; // Sets the session.
header("Location: index.php"); // Goes to main page.
exit(); // Stops the rest of the script.
} else { // Invalid username/password.
exit("Incorrect username/password!"); // Stops the script with an error message.
}
}
}
mysql_close($db_connect); // Closes the connection.
?>