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.";
}
?>