hey i followed a tutorial on youtube
now i have an error on the index.php file
lign 122
its the div and the wrapper one
i dont know how to close it
or remove the error message
please help
if (navigator.appName == "Microsoft Internet Explorer") { document.location = "FILL RE-DIRECT LINK HERE! ex. iehome.php";
}
<? include("inc/incfiles/header.inc.php");?>
<?
$reg= @$_POST('reg');
//declaring variables to prevent errors
$fn =""; //First Name
$ln=""; //Last Name
$un=""; // Username
$em=""; // Email
$em2=""; //Email2
$pswd=""; //Password
$pswd2=""; //Password2
$d=""; // Sign Up Date
$u_check=""; // Check if username exists
// Registration Form
$fn= strip_tags(@$_POST['fname']);
$ln= strip_tags(@$_POST['lname']);
$un= strip_tags(@$_POST['username']);
$em= strip_tags(@$_POST['email']);
$em2= strip_tags(@$_POST['email2']);
$pswd= strip_tags(@$_POST['password']);
$pswd2= strip_tags(@$_POST['password2']);
$d= date("Y-m-d"); // Year-Month-Day
if ($reg){
if ($em=$em2) {
// Check if user already exists
$u_check= mysql_query("SELECT username FROM users WHERE username='$un'");
// Count the amount of rows where username = $un
$check= mysql_num_rows($u_check);
if ($check ==0) {
// check all of the fields have been filed in
if ($fn&&$ln&&$em&&$em2&&$pswd&&$pswd2) {
// checks that password matches
if ($pswd==$pswd2) {
//checks the username/first name/last name does not exceeed 25 characters
if (strlen($un)> 25 || strlen($fn)> 25 || strlen($ln)> 25 ) {
echo "The maximum limit for username/first name /last name is 25 characters!";
}
else
{
// check the maximum length of password does not exceed 25 characters and is not less than 5 chracters
if (strlen($pswd)>30 || strlen($pswd)< 5) {
echo" Your password must be between 5 and 30 characters long!";
}
else
{
//encrypt the password and the password2 using md5 before sending the database
$pswd=md5($pswd);
$pswd=md5 ($pswd2);
$query= mysql_query("INSERT INTO users VALUES ('','$un','$fn','$ln','$em','$pswd','$d','0')");
die ("<h2> Welcome to Funtimeout.com</h2> Login to your account to get started...");
}
}
}
else {
echo "Your passwords dont match!";
}
}
else
{
echo "Please fill in all the fields...";
}
}
else
{
echo" Username already taken...";
}
}
else{
echo "Your E-mails dont match!";
}
}
?>
<?
//Starts the session
session_start();
//checks whether the user is logged in or not
if (!isset($_SESSION["user_login"])); {
exit();
}
else
{
header("location:home.php");
}
?>
<?
//Login Script
if(isset($_POST["user_login"]) && isset($_POST["password_login"])) {
$user_login = preg_replace('#[^A-Za-z0-9]#i','',$_POST["user_login"]);//filter everything
$password_login = preg_replace('#[^A-Za-z0-9]#i','',$_POST["password_login"]);//filter everything but numbers and letters
$md5password_login=md5($password_login);
$sql = mysql_query("SELECT id FROM users WHERE username='$user_login' AND password='$md5password_login' LIMIT 1");// query the person
//Check for their existence
$userCount= mysql_num_rows($sql); //Count the number of rows returned
if($userCount==1) {
while($row=mysql_fetch_array($sql)){
$id=$row["id"];
}
$_SESSION["id"]=$id;
$_SESSION["user_login"]=$user_login;
$_SESSION["password_login"]=$user_password;
exit("<meta http-equip=\"refresh\"0>\");
}else{
echo 'The information is incorrect, try again';
exit();
}
}
<?
<div id="wrapper">
<br />
<br />
<br />
<br />
<div style="float:left">
?>
<table class="homepageTable>
<tr>
<td width="60%" valign="top">
<h2> Already a Member ? Login below ... </h2>
<form action="index.php" method="post" name="form1" id="form1">
<input type="text" size="25" name ="user_login" id="user_login" placeholder"username"/>
<input type="password" size="25" name ="password_login" id="password_login" placeholder"password"/><br/>
<input type="submit" name="button" id="button" placeholder="Login to your account"">
</form>
</td>
<td width="40%" valign="top">
<h2> Sign Up below... </h2>
<form action="#" method="post">
<input type="text" size"25" name="fname" placeholder="First Name" value="<? echo $fn; ?>">
<input type="text" size"25" name="lname" placeholder="Last Name" value="<? echo $ln; ?>">
<input type="text" size"25" name="username" placeholder="Username"value="<? echo $un; ?>">
<input type="text" size"25" name="email" placeholder="Email" value="<? echo $em; ?>">
<input type="text" size"25" name="email2" placeholder="Repeat Email" value="<? echo $em2; ?>">
<input type="password" size"25" name="password" placeholder="Password"">
<input type= "password" size"25" name="password2" placeholder="Repeat Password"">
<input type="submit" name="reg" placeholder="Sign Up"">
</td>
</tr>
</table>
</body>
</html>