Jump to content
Updating IPB tonight Read more... ×


This topic is now archived and is closed to further replies.


Login problems

Recommended Posts

I used Dreamweaver to make a "supplies.php" that has a login link. The link takes you to login.php that I made using DW's user auth. behaviors. When the correct login is enterd you are redirected back to "suppliers.php" and the "Login" link should be replaced with "Logout". This is not working. The login works and redirects, its just the "suppliers.php" page doesnt swap the "Login" with "Logout"


Here the code for login.php and suppliers.php



<?php require_once('Connections/conn_features.php'); ?>
// *** Start the session
if (!session_id()) session_start();
// *** Validate request to log in to this site.
if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING']!="") $FF_LoginAction .= "?".htmlentities($HTTP_SERVER_VARS['QUERY_STRING']);
if (isset($HTTP_POST_VARS['username'])) {
 $FF_rsUser_Source="SELECT username, password ";
 if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
 $FF_rsUser_Source .= " FROM users WHERE username='" . $FF_valUsername . "' AND password='" . $FF_valPassword . "'";
 mysql_select_db($database_conn_features, $conn_features);
 $FF_rsUser=mysql_query($FF_rsUser_Source, $conn_features) or die(mysql_error());
 $row_FF_rsUser = mysql_fetch_assoc($FF_rsUser);
 if(mysql_num_rows($FF_rsUser) > 0) {
   // username and password match - this is a valid user
   if ($FF_fldUserAuthorization != "") {
   } else {
   if (isset($accessdenied) && false) {
     $FF_redirectLoginSuccess = $accessdenied;
$FF_login_failed = false;
   header ("Location: $FF_redirectLoginSuccess");
 $FF_login_failed = true;
 header ("Location: $FF_redirectLoginFailed");




<?php require_once('Connections/conn_features.php'); ?>


$colname_suppliers = "1";
if (isset($_GET['company'])) {
 $colname_suppliers = (get_magic_quotes_gpc()) ? $_GET['company'] : addslashes($_GET['company']);
mysql_select_db($database_conn_features, $conn_features);
$query_suppliers = sprintf("SELECT * FROM suppliers WHERE company = '%s' ORDER BY id ASC", $colname_suppliers);
$suppliers = mysql_query($query_suppliers, $conn_features) or die(mysql_error());
$row_suppliers = mysql_fetch_assoc($suppliers);
$totalRows_suppliers = mysql_num_rows($suppliers);


LOGIN AND LOGOUT LINKS 1(this code makes the supplers.php page come up blank)

if(isset(($_SESSION['MM_Username'])) && isset(($_SESSION['MM_UserAuthorization']))) { 
 echo '<a href="logout.php" class="link-main" >logout</a>'; 
else { 
 echo '<a href="login.php?page=' . $_SERVER['PHP_SELF'] . '" class="link-main" >Admin Login</a>'; 



LOGIN AND LOGOUT LINKS 2(Thisis the code ive had working before but it wont now)

<?php if(($_SESSION['MM_Username']) !="") { ?>
   <a href="logout.php" class="adminlink" >logout</a> 
   <?php } ?>

<?php if(($_SESSION['MM_Username']) =="") { ?>
   <a href="login.php?page=<?php echo $_SERVER['PHP_SELF']; ?>" class="adminlink" >Admin 
   <?php } ?>

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.