01-09-2017, 09:22 AM
I have a page that calls update.php via jQuery whenever a input field is changed. How do I check if a user is logged in? do I have to also load init.php at the top of update.php?
I currently use the following code:
<pre></pre>
But I wonder if this is the correct way or if there is a better way.
I currently use the following code:
<pre>
Code:
<?php
require_once 'users/init.php';
if($user->isLoggedIn()){
//some script
}
else{
echo 'go away!';
}
?>
But I wonder if this is the correct way or if there is a better way.