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
Authentication from external php page
#4
My thought would be to rename your table from users to users2 then write a script to foreach through your existing users and put whatever data you have in your users table into ours because you're going to need some of those fields.

Something like...
$migrate = $db->query("SELECT * FROM users2")->results();
foreach($migrate as $m){
$fields = array(
'username'=>$m->username,
'fname'=>$m->fname,
);
$db->insert('users',$fields);
}

In that above example 'username' is the column name in the userspice db, and $m->username the username is the column name in your db, so if yours are different just change it.

Then your login page (should obviously check username and password), but all it has to do is when it finds the user with the matching username and password set $_SESSION['user'] = //the id of the user that logged in

That's it. From there, you're logged in as userspice.
My suggestion would be to put your own login.php form in usersc/login.php this way yours will load instead of ours and the updates won't break it.
  Reply


Messages In This Thread
RE: Authentication from external php page - by mudmin - 01-14-2019, 04:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)