i'm trying to code something in my memberpage to keep unregistered member to view..
my code for the login.php is
PHP:
--------------------------------------------------------------------------------
<?php
/ **************************************************
* Login page. There are links to this page from *
* the header on every other page for logged-out *
* users only. *
**************************************************
/
require_once('login_funcs.php');
// If they're logged in, log them out
// They shouldn't be able to see this page logged-in
// This allows the same page to be used as a logout script
if ($LOGGED_IN = user_isloggedin()) {
user_logout();
$_COOKIE['user_name'] = '';
unset($LOGGED_IN);
}
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';
}
if ($feedback == 1) {
// On successful login, redirect to homepage
// header("Location: memberpages/index.php");
header("Location:<a href="http://www.test.com/memberpage/index.php" target="_blank">[url]http://www.test.com/memberpage/index.php[/url]</a>");
} else {
$feedback_str = "<P class=\"errormess\">$feedback</P>";
}
} else {
$feedback_str = '';
}
// ----------------
// DISPLAY THE FORM
// ----------------
<FORM ACTION="$php_self" METHOD="POST">
<P CLASS="bold">Username<BR>
<INPUT TYPE="TEXT" NAME="user_name" VALUE="" SIZE="10" MAXLENGTH="15"></P>
<P CLASS="bold">Password<BR>
<INPUT TYPE="password" NAME="password" VALUE="" SIZE="10" MAXLENGTH="15"></P>
<P><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login"></P>
</FORM>
my 'login_funcs.php' simply validate the login.php
my index.php (where member's go after they logged in)
just a regular HTML page...i don't have anything to check if user is logged in or not from my index.php page...