The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
secure AJAX update.php with init.php
#1
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>
Code:
<?php
require_once 'users/init.php';
if($user->isLoggedIn()){
   //some script
}
else{
echo 'go away!';
}
?>
</pre>


But I wonder if this is the correct way or if there is a better way.
  Reply


Messages In This Thread
secure AJAX update.php with init.php - by emanresu - 01-09-2017, 09:22 AM
secure AJAX update.php with init.php - by mudmin - 01-11-2017, 12:27 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)