had a toggle for authorisation works now is not - HELP PLEASE

This is a previous discusson

I had a user landing page where after they login, if they were allowed that they woould go to their page, otherwise they would be redirected

I was working and now it seems not to be, the code is used for redirection has been

<? PHP if (! $Recordset1 ['auth']) {}

header ("Location: http://www.websitename/your_waiting_for_authorization_page.php");

Exit();

} ? >

the column in the database, phpMySQL is called auth and it is defined as

tinyint (2) NO. 0Browse distinct valuesChangeDropPrimaryUniqueIndexFulltext

I have a page where I can change the value 0 to 1

the code on the landing page is

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

<? PHP

initialize the session

If (! isset {})

session_start();

}

* Log out the current user. **

$logoutAction = $_SERVER ['PHP_SELF']. » ? doLogout = true;

If ((isset & & ($_SERVER ['QUERY_STRING']! = "")) {})

$logoutAction. = '& '. htmlentities($_SERVER['QUERY_STRING']);

}

{If ((isset($_GET['doLogout'])) & & ($ {_GET ['doLogout'] == "true"))}

to completely disconnect a visitor, you must delete the session varialbles

$_SESSION ['MM_Username'] = NULL;

$_SESSION ['MM_UserGroup'] = NULL;

$_SESSION ['PrevUrl'] = NULL;

unset($_SESSION['MM_Username']);

unset($_SESSION['MM_UserGroup']);

unset($_SESSION['PrevUrl']);

$logoutGoTo = "... / index.html";

If {($logoutGoTo)

Header ("Location: $logoutGoTo");

"exit";

}

}

? >

<? PHP

If (! isset {})

session_start();

}

$MM_authorizedUsers = "";

$MM_donotCheckaccess = "true";

Restrict access to Page: grant or deny access to this page

Function isAuthorized ($strUsers, $UserGroup, $strGroups, $UserName) {}

For safety, first assuming that the visitor is NOT allowed.

$isValid = false;

When a visitor is connected to this site, the MM_Username of Session variable value equal to their username.

So, we know that a user is NOT logged if this Session variable is empty.

If (! empty ($UserName)) {}

In addition to being connected, you can restrict access to only certain users based on a created ID when they connect.

Analyze the channels in the tables.

$arrUsers = explode (",", $strUsers);

$arrGroups = explode (",", $strGroups);

If (in_array ($UserName, $arrUsers)) {}

$isValid = true;

}

Or, you can restrict access to only certain users based on their user name.

If (in_array ($UserGroup, $arrGroups)) {}

$isValid = true;

}

If (($strUsers == "") & & true) {}

$isValid = true;

}

}

return $isValid;

}

$MM_restrictGoTo = 'failed - login.php.php ";

If (!) {(((isset($_SESSION['MM_Username']))) & & (isAuthorized ("", $MM_authorizedUsers, $_SESSION ['MM_Username'], {$_SESSION ['MM_UserGroup']})))}

$MM_qsChar = ';?

$MM_referrer = $_SERVER ['PHP_SELF'];

If (strpos ($MM_restrictGoTo, "?")) $MM_qsChar = "&";

If (isset($_SERVER['QUERY_STRING']) & & strlen($_SERVER['QUERY_STRING']) > 0)

$MM_referrer. = « ? ». $_SERVER ['QUERY_STRING'];

$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar. "accesscheck =". UrlEncode ($MM_referrer);

Header ("Location:".) $MM_restrictGoTo);

"exit";

}

? >

<? PHP

If (! function_exists ("GetSQLValueString")) {}

function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

If (via PHP_VERSION < 6) {}

$theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

}

$theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

Switch ($theType) {}

case 'text ':

$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

break;

case "long":

case "int":

$theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

break;

case "double":

$theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

break;

case "date":

$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

break;

case "set":

$theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

break;

}

Return $theValue;

}

}

$colname_Recordset1 = "-1";

If (isset($_SESSION['MM_Username'])) {}

$colname_Recordset1 = $_SESSION ['MM_Username"];

}

@mysql_select_db ($database_nameprop, $nameprop);

$query_Recordset1 = sprintf ("" SELECT * FROM tenant_signup, name_editprop WHERE the name_editprop.prop_id = tenant_signup.prop_id AND userid = %s ", GetSQLValueString ($colname_Recordset1,"text")");

$Recordset1 = mysql_query ($query_Recordset1, $hostprop) or die (mysql_error ());

$row_Recordset1 = mysql_fetch_assoc ($Recordset1);

$totalRows_Recordset1 = mysql_num_rows ($Recordset1);

? >

<? PHP if (! $Recordset1 ['auth']) {}

header ("Location: http://www.propertywebsite.com/your_waiting_for_authorization_page.php");

Exit();

} ? >

I don't know if it was something I did on the administration page, because I wanted to option buttons to activate the page and disable the page
can anyone help please

Yes!  It was a trial

Tags: Dreamweaver

Similar Questions

Maybe you are looking for