Problem getting this to pass from one area to the next.
footer.html
</td>
<td valign="top" width=20%>
<!-- start left navigation -->
<?php
// Display links based upon the login status.
if (isset($SESSION['member']) AND (substr($SERVER['PHP_SELF'], -10) != 'logout.php')) {
include('login_status.php'); //If logged in it will show member info.
;
} else {
include('login.php'); //If not logged in it will show login form.
}
?>
<p></p>
<?php
include('search.php');
?>
<p></p>
<?php
include('doistats.php');
?>
<p></p>
<table width="100%" border="0" cellspacing="1" cellpadding="1" class="outline">
<tr><td class=head2>Affiliates</td></tr>
<tr><td>Filler</td></tr>
<tr><td>Filler</td></tr>
<tr><td>Filler</td></tr>
<tr><td>Filler</td></tr>
<tr><td>Filler</td></tr>
</table>
</td></tr>
</table>
<!-- end left navigation -->
</td>
</tr>
<tr><td align="center" colspan=3> </td></tr>
<tr><td align="center" colspan=3 class=footer><p align=center>Copyright Notice!</p></td></tr>
</table>
<!-- end main area -->
</td></tr></table>
</body>
</html>
I can get the login working which does bring it to the login_status.php page.
login.php
<form action="forms/memb_login.php" method="post">
<table width="100%" border="0" cellspacing="1" cellpadding="1" name="menu" class="outline">
<tr><td valign=top class=head2 colspan=2>Member Login</td></tr>
<tr>
<td>UserName:</td>
<td>
<input class=title name="name" type="text" id="name" style="width: 100px;" maxlength="30" value="">
</td></tr>
<tr>
<td>Password:</td>
<td>
<input class=title name="password" type="password" id="password" maxlength="30" style="width: 100px;">
</td></tr>
<tr><td></td>
<td>
<input class=head type="submit" name="Submit" value="Login">
<input class=head type="reset" name="Reset" value="Clear">
</td></tr>
<tr><td colspan=2 align=center>Forgot Password <a href="register.php">Register</a></td></tr>
</table>
</form><!-- End of Form -->
memb_login.php
<?php
// For register_global on PHP settings
$name = $_POST['name'];
$password = $_POST['password'];
// MySQL Connection Variables
// Fill in your values for the next 4 lines
$hostname='localhost';
$user=''; //user name for MySQL database
$pass=''; //Password for database
$dbase=''; //database name
$connection = mysql_connect("$hostname" , "$user" , "$pass") or die ("Can't connect to MySQL");
$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
// Check for empty fields
if (empty($name) || empty($password))
{
die ("Error. Please fill in all required fields."); // once a die statement is execute, the whole script stops executing
}
// Match Row in Database
$qChk = "select name from membership where name='$name' and password='$password' and status='Y' ";
$rsChk = mysql_query($qChk);
$rowCount = mysql_num_rows($rsChk);
if ($rowCount !='1') // query did not return 1 row, user is not verified
{
die ("Error. Your password does not match your username or your account was not yet activated. Please try again.");
}
// User is login. Let's give him a cookie. *Munch*
setcookie ("member",$name,time()+1957240,"/");
$member = $name;
session_register("member"); // set session, just in case cookie is blocked.
// Update Login timer
$qUpdate = "update membership set login = now() where name='$name' and password='$password' and status='Y' ";
$rsUpdate = mysql_query($qUpdate);
if ($rsUpdate)
{
header("Location: /index.php"); // redirects members to a welcome member page
}
?>
login_status.php
<table width="100%" border="0" cellspacing="1" cellpadding="1" name="menu" class="outline">
<tr><td valign=top class=head2 colspan=2>Member Account</td></tr>
<tr><td colspan=2>
Member: <br/>
Profile || Update<br/>
<a href="logout.php">Logout</a><br/>
Change Password</td></tr>
</table>
This is where I have a problem, I want it show the member name and in the future a few other things. I have tried using {$_SESSION['member']} to pull up the member name as in the login processer it sets $member = $name but iit just pulls up the member box as blank.
Any help or point in the right direction would be greatly appreciated.