Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6162007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:34:44+00:00 2026-05-23T21:34:44+00:00

I am trying to create an app on android which makes users login in

  • 0

I am trying to create an app on android which makes users login in and I am using phonegap.
Here is my code but when i run it i get an error

here is my index.html

<html>
<head>
<script type="text/javascript"  src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript" >
function login() {
$(document).ready(function() {
var user = $("#user")[0].value;
var pass = $("#pass")[0].value;
$.ajax({
type:"GET",
url:"newlogin.php",
data: "user="+user+"&pass="+pass,
success: function(result){
if (result){
$("#message")[0].value = "Success "+result;
}
else {
$("#message")[0].value = "error";
}
}
});
});
}
</script>
<style type="text/css">
body{
margin:auto;
width:100%;
display: table;
background-color: #333;
}
form{
text-align: center;
height: 500px;
display: table-cell;
vertical-align: middle;
}
input{
font-size: 20px;
text-shadow: #ccc 2px 2px;
text-align: center;
}
input#message {
background-color: transparent;
border: 0;
color: white;
text-shadow: #5191C1 2px 2px;
}
</style>
</head>
<body>
    <form>
    <input type="text" size="25" id="user" onkeyup= "login()" />
    <br />
    <input type="text" size="25" id="pass" onkeyup= "login()"/>
    <br />
    <input type="text" size="25" id="message" value="hey" />
    </form>

</body>
</html>

and here is the newlogin.php it connects to

<?php 
$user = $_REQUEST['user'];
$pass = $_REQUEST['pass'];

mysql_connect("localhost","root","sercet") or die(mysql_error());
mysql_select_db("book") or die(mysql_error());

$result = mysql_query("SELECT username,password,id FROM book_users WHERE username = '$user'");
while($row = mysql_fetch_array($result)) {
    if($pass == $row["password"]){
        echo $row["id"];
        } 
        else {
            echo "";
            }

    }

?>

I hope you code help me find the solution to this problem

I Get the error at where it shows the message where it reads "Sucess + result" i get Sucess<?php user =$_REQUEST('user')……. <- thats all i could see in the emulator
I am not sure if it might be that phonegap cannot execute php file

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:34:46+00:00Added an answer on May 23, 2026 at 9:34 pm

    I am suspecting (because you use a local url for calling “your server” and you ask if phonegap can´t execute php) that you deployed a php file with your an to the phone. Phonegap can not execute php you need a server running php for that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to create a simple pan and zoom app using silverlight 4, but
I'm trying to create a setup activity for my Android application which my users
Here is my code, i am trying to run in the Android. It runs
I'm trying to create an Android app in Java (using Ubuntu 11.10 with the
I'm trying to create a simple Android app which saves a text from an
I'm trying to create an app for Android that simply sends a command to
I'm trying to create a rails app, but somethings going wrong, I'm getting a
I am trying to create a simple 3-D app for android that will have
I'm trying to create a web scraper for my coming android app. Therefore I
Hi there I am trying to create a bug-free jquerymobile app across Android Browser,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.