hey im atm learn Php,html,c++,css,asm etc..
but i dont know that part of code:
what that mean? and if i delete it? and why betwen " " red part are nothing? thanks to Answere and if u want flam Dont Post...Quote:
if($_SESSION[UserID] == "")
Printable View
hey im atm learn Php,html,c++,css,asm etc..
but i dont know that part of code:
what that mean? and if i delete it? and why betwen " " red part are nothing? thanks to Answere and if u want flam Dont Post...Quote:
if($_SESSION[UserID] == "")
A PHP session solves this problem by allowing you to store user information on the server for later use (i.e. username, shopping cart items, etc). However, this session information is temporary and is usually deleted very quickly after the user has left the website that uses sessions.
PHP Tutorial - Session
So in this case it checks if there is something in the sesion 'UserID'.
If the session UserId = empty then,
Thanks realy and for Web also :p
Let me guess, this is from MPOG?
Well this is just to show if the user has logged in or not.
This is like nothing of what the whole block of code is, btw this is php lawl
But first you would have to create that "session" with some form of connection of login panelPHP Code:if($_SESSION[UserID] == "") {
echo "User Offline";
}
else{
echo "User Online";
}
something like
PHP Code:if(isset($_POST['submit']))
{
$userid = $_POST[field1]);
$passid = $_POST[field2];
$querytologin= mssql_query("SELECT l.UserID, l.AID, c.UGradeID, l.Password FROM Login(nolock) l INNER JOIN Account(nolock) c ON l.AID = c.AID WHERE l.UserID = '$userid' AND l.Password = '$passid' ");
if(mssql_num_rows($querytologin) == 1)
{
$fetchquery = mssql_fetch_row($querytologin);
$_SESSION[UserID] = $fetchquery[0];
// More session's (look the query's (: )
// eg. : $_SESSION[AID] = $fetchquery[1];
// Order: UserID, AID, UgradeID, Password
// Good login, redir to index
}else{
// bad login bla bla.try again
}
}