note 54757 added to function.session-start

From: Date: Thu, 14 Jul 2005 12:44:08 +0000
Subject: note 54757 added to function.session-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-91959@lists.php.net to get a copy of this message
<?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 ---- Manual Page -- http://www.php.net/manual/en/function.session-start.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54757 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54757&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54757&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54757&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54757&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54757&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54757&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54757&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91959) next »