I am trying to direct users to their appropriate direction. if a user has already registered their business, they don't need to see the registeration form again, but to just send them to the main page.
...if ur still confused, once a user logs in, user will be directed to either they have already registered their business or not. if they did, send them to "A" if not then "B" B is the registration form. once they logout, and login again, they will just be directed to "A" and not "B" because they are already registered.
...HOw I did this was to put a "1" into my database when they registered. I put "1" in a field name "bus_registered". When a user logs in, the code will detect if the "1" exits, if so, direct them to "A" if not, then "B" B again, is the registration form.
I did the best with my code below for the login.php
if ($_POST['submit'] == 'Login') {
if (strlen($_POST['user_name']) <= 25 && strlen($_POST['password']) <=25) {
$feedback = user_login();
} else {
$feedback = 'ERROR - Username and password are too long';
}
$query = "SELECT bus_confirmed
FROM BusinessName
WHERE bus_confirmed = 1";
$result = mysql_query($query);
if ($feedback == 1) && ($result && mysql_num_rows($result) > 1) {
// Register the input with the value
$_SESSION['user_name'] = $_POST['user_name'];
session_register("authr_user_name");
$authr_user_name = $_POST['user_name'];
// On successful login, redirect to homepage
header("Location: A ");
} else {
header("Location: B");
} else {
$feedback_str = "<P class=\"errormess\">$feedback</P>";
}
} else {
$feedback_str = '';
}
any help would be greatly appreciated!!!!!
MY error for the moment is
Parse error: parse error in /virtual/buzzabiz.com/home/web/public_html/login.php on line 40
line 40 =
if ($feedback == 1) && ($result && mysql_num_rows($result) > 1)
($feedback == 1) is called from another form to check if they have their username and userid confirmed.