note 54757 deleted from function.session-start by betz

From: Date: Thu, 14 Jul 2005 13:36:12 +0000
Subject: note 54757 deleted from function.session-start by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-91962@lists.php.net to get a copy of this message
Note Submitter: klerol at mail dot ru Reason: bad code ---- <?php // *** Restrict Access To Page: Grant or deny access to this page $FF_authorizedUsers=" "; $FF_grantAccess=0; session_start(); if (isset($HTTP_SESSION_VARS["MM_Username"])) { if (true || !(isset($HTTP_SESSION_VARS["MM_UserAuthorization"])) || $HTTP_SESSION_VARS["MM_UserAuthorization"]=="" || strpos($FF_authorizedUsers, $HTTP_SESSION_VARS["MM_UserAuthorization"])) { $FF_grantAccess = 1; $colname_getuid = "1"; if (isset($HTTP_SESSION_VARS['MM_Username'])) { $colname_getuid = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['MM_Username'] : addslashes($HTTP_SESSION_VARS['MM_Username']); } $query_getuid = sprintf("SELECT uid FROM " . $table_prefix . "user WHERE email = '%s'", $colname_getuid); $getuid = mysql_query($query_getuid) or die(mysql_error()); $row_getuid = mysql_fetch_assoc($getuid); $totalRows_getuid = mysql_num_rows($getuid); $userid = $row_getuid['uid']; } } if (!$FF_grantAccess) { $FF_qsChar = "?"; if (strpos($FF_authFailedURL, "?")) $FF_qsChar = "&"; $FF_referrer = $PHP_SELF; if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) $FF_referrer .= "?" . $QUERY_STRING; $FF_authFailedURL = $FF_authFailedURL . $FF_qsChar . "accessdenied=" . urlencode($FF_referrer); header("Location: $FF_authFailedURL"); exit; } ?> Notice: A session had already been started - ignoring session_start() in c:\inetpub\wwwroot\store\include\site_user\inc_restriction.php on line 4

« previous php.notes (#91962) next »