The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (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
Login validation with Android App
#1
Hi guys,

I'm new to userspice and have been building an IOT platform using the system. Its coming together well. I now need to allow login from an android app to the platform.

At the moment, I'm just trying to send a validation message that the user and password are correct. I've tried using POST to send the data to the login form but I am not getting any response. When I try it in Postman, I get an error page with the message:

"There was an error with your form. Please go back and try again. Please note that submitting the form by refreshing the page will cause an error."

Am I going about this the wrong way?
  Reply
#2
I solved the problem. I just learned how the login.php file worked and made a second login file just for the smartphone app.

Code:
<?php

// This is a user-facing page
//This page has been written to allow the app to login to the website

$uname=$_POST["username"];
$pword=$_POST["password"];
ini_set("allow_url_fopen", 1);
if(isset($_SESSION)){session_destroy();}
require_once '../users/init.php';


$validate = new Validate();
$user = new User();
$remember=true;
$login = $user->loginEmail($uname, trim($pword), $remember);



if ($login) {
    echo "Valid username and password provided. ";
    // Do actions for smartphone app

}

else {
        echo "Validation failure.";
      }

?>
  Reply
#3
Is everything working properly? If you need help making that api, let me know. Sorry I wasn't on the forums yesterday.
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)