Help PHP Beginner, the ASP code to PHP
<%
Dim user
user= session ("user")
If user= "" Then
User=request.cookies ("User")
If user= "" Then
User=getuser ()
Response.Cookies ("user") =user
Response.Cookies ("User"). expires= #January 01, 2036#
End If
End If
Session ("User") =user
function GetUser ()
;
End Function
%>
------Solution--------------------
$user = $_session (' user ');
if ($user = = ") {
$user =$_cookie (' user ');
if ($user = = ") {
$user =getuser ();
Setcookie (' User ', User,time () +30*365*24*60*60);
}
}
$_session (' user ') = $user;
function GetUser () {
}
?>
------Solution--------------------
$user =$_session[' user '];
if ($user = = "")
{
$user =$_cookie[' user '];
if ($user = = "")
{
$user =getuser ();
Setcookie ("User", $user, 99999999);
}
}
$_session[' user ']= $user;
function GetUser ()
{
;
}
?>
I remember that the ASP = number is also assigned, ah, if user= "" is to determine whether the user is empty or empty value?
------Solution--------------------
I remember that the ASP = number is also assigned, ah, if user= "" is to determine whether the user is empty or empty value?
----------------------------
At the time of judgment is judgment, in devaluation is the time is devaluation.
If user= "" judgment
User= "" devaluation.
------Solution--------------------
is auto to Comp
------Solution--------------------
$user = $_session (' user ');
if ($user = = ") {
$user =$_cookie (' user ');
if ($user = = ") {
$user =getuser ();
Setcookie (' User ', User,time () +30*365*24*60*60);
}
}
$_session (' user ') = $user;
function GetUser () {
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.