Jump to content

Recommended Posts

Posted

Dreamweaver says there is a problem with line 73

 

cannot see it i have codeblock, my mind is cabbaged.

 

some one just clear this up for me please

 

thankyou in advance

 

 

 

 

<?php

session_start();

if(!isset($_SESSION["manager"])){

header("location: index.php");

exit();

}

// parse the log in form if the user has filled it out and pressed "Log in"

if (isset($_POST["username"])&& isset($_POST["password"])){

 

//remeber 2 double quotes ,"",$_POST["username"] and the same on password line.

$manager = preg_replace('#[^A_Za-z0-9]#i',"",$_POST["username"]); //filter everything but numbers and letters

$password = preg_replace('#[^A_Za-z0-9]#i',"",$_POST["password"]); //filter everything but numbers and letters

//Connect to the MySQL database

include "../storescripts/connect_to_mysql.php";

$sql= mysql_query("SELECT * FROM admin WHERE id='$manager'AND $passord='$password' LIMIT 1"); //query the person --make sure person exists in database----

$existCount= mysql_num_rows($sql); //count the row nums

if($existCount==1){ //evaluate the count

while($row =mysql_fetch_array($sql)){

$id=$row["id"];

}

$_SESSION["id"]=$id;

$_SESSION["manager"]=$manager;

$_SESSION["password"]=$password;

header("location: index.php");

exit();

}else{

echo 'That information is incorrect. try again<a href="index.php">Click Here</a>';

exit();

}

?>

 

<!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>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>astore admin area</title>

<link rel="stylesheet" href="../sytle/style.css" type="text/css" media="screen" />

 

<style type="text/css">

a:link {

text-decoration: none;

}

a:visited {

text-decoration: none;

}

a:hover {

text-decoration: none;

}

a:active {

text-decoration: none;

}

</style>

</head>

 

<body>

<div align="center" id="mainwrapper">

<?php include_once("../template-header.php"); ?>

</div>

<div id="pagesidebar">

<div align="center">TEST</div>

</div>

<div id="pagecontent">

<div align="center">

<div align="left" style="margin-left:24px;">

<h2>Hello store manager, what would you like to do today?</h2>

<p><a href="inventory_list.php">Manage Inventory</a></p>

<p><a href="#">Manage Blah Blah Blah</a></p>

</div>

TEST</div>

</div>

<div align="center">

<?php include_once("../template-footer.php"); ?>

</div>

</div>

</body>

</html>

Posted

At a glance, it seems there is no closing braces for an if statment

 

Line :

if (isset($_POST["username"])&& isset($_POST["password"])){

 

never gets closed as far as I can see

Posted

At a glance, it seems there is no closing braces for an if statment

 

Line :

if (isset($_POST["username"])&& isset($_POST["password"])){

 

never gets closed as far as I can see

 

It is closed right before else }else{

 

Will you please write down the description of the problem as well? If it is related with SQL, I guess you misspelled the col name (passord instead of password).

 

Mustafa

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...