后端开发|php教程
nbsp,theValue,mysql,session,gt
后端开发-php教程
求大神给指点下这些代码有什么问题啊,为什么session变量不生效啊
分佣系统源码,vscode保存时出错,ubuntu安装rdkit,tomcat老是自动关闭,fizzler 爬虫,php 支持png,文山seo培训哪个好,带有手风琴css特效的网站,h5 app商城模板下载lzw
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
css高效开发实战 源码,ubuntu辨认网卡,怎么将项目放进tomcat,ie控件爬虫,php做文件管理系统,seo公司排名网络服务费用lzw
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
免费办公管理源码,ubuntu配置ssh密钥,网络爬虫用什么,php个位十位相加,唐山seo顾问lzw
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;
}
}
mysql_select_db($database_yiwuyiwu, $yiwuyiwu);
$query_Recordset1 = "SELECT * FROM `user`";
$Recordset1 = mysql_query($query_Recordset1, $yiwuyiwu) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
// ***session变量开始了
$loginFormAction = $_SERVER[PHP_SELF];
if (isset($_GET[accesscheck])) {
$_SESSION[PrevUrl] = $_GET[accesscheck];
}
if (isset($_POST[Username])) {
$loginUsername=$_POST[Username];
$password=(md5($_POST[Password]));
$MM_fldUserAuthorization = "enable";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "zhuce.php";
$MM_redirecttoReferrer = false;
//*** 输入账号和密码,判断转向页面。
mysql_select_db($database_yiwuyiwu, $yiwuyiwu);
$LoginRS__query=sprintf("SELECT u_id u_name, pass, enable FROM `user` WHERE u_name=%s AND pass=%s",
//*** 启用符号是这个“·”
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $yiwuyiwu) or die(mysql_error());
$row_LoginRS = mysql_fetch_assoc($LoginRS);
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,enable);
//*** 声明三个会话变量并分配值
$_SESSION[MM_Username] = $loginUsername;
$_SESSION[MM_UserGroup] = $loginStrGroup;
$_SESSION[u_id]= $row_LoginRS(u_id);
if (isset($_SESSION[PrevUrl]) && false) {
$MM_redirectLoginSuccess = $_SESSION[PrevUrl];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
登录系统
<form ACTION="" name="form1" method="POST">
用户登陆 |