Seniors, help solve this problem

Source: Internet
Author: User
Seniors, help solve this problem
I made a login user's page, done well, in the case of a plain page, I gave it a login user authentication. The code is then generated on top of it.

if (!function_exists ("getsqlvaluestring")) {
function getsqlvaluestring ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (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 "defined":
$theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
Break
}
return $theValue;
}
}
?>
Validate request to login to this site.
if (!isset ($_session)) {
Session_Start ();
}

$loginFormAction = $_server[' php_self ');
if (Isset ($_get[' AccessCheck ')) {
$_session[' prevurl '] = $_get[' AccessCheck '];
}

if (isset ($_post[' username ')) {
$loginUsername =$_post[' username '];
$password =$_post[' USERPSW '];
$MM _flduserauthorization = "";
$MM _redirectloginsuccess = "admin.php";
$MM _redirectloginfailed = "index.php";
$MM _redirecttoreferrer = true;
mysql_select_db ($database _boardconn, $boardConn);

$LoginRS __query=sprintf ("Select Username, userpsw from board_admin WHERE username=%s and userpsw=%s",
Getsqlvaluestring ($loginUsername, "text"), getsqlvaluestring ($password, "text"));

$LoginRS = mysql_query ($LoginRS __query, $boardConn) or Die (Mysql_error ());
$loginFoundUser = mysql_num_rows ($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

if (php_version >= 5.1) {session_regenerate_id (true);} else {session_regenerate_id ();}
Declare session variables and assign them
$_session[' mm_username '] = $loginUsername;
$_session[' mm_usergroup '] = $loginStrGroup;

if (Isset ($_session[' Prevurl ')) && true) {
$MM _redirectloginsuccess = $_session[' Prevurl ');
}
Header ("Location:".) $MM _redirectloginsuccess);
}
else {
Header ("Location:".) $MM _redirectloginfailed);
}
}
?>
But I'm browsing.
This error occurs on the page:
Warning:session_start () [Function.session-start]: Cannot send session cache Limiter-headers already sent (output Starte D at E:\appserv\www\webboard2\login.php:2) in E:\AppServ\www\webBoard2\login.php on line 5

Had foreseen such a problem before, it would have Validate request to login to this site.
if (!isset ($_session)) {
Session_Start ();
}
This section of the PHP code on the line, this time do not know how still not, to help solve the next, thank you



------Solution--------------------
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.