Call PHP files on Android application?
<p>I have made a web application and want to port it over to an Android APK file. However, none of my PHP files work. When I try and view one all I get is PHP code. This is what I have so far in my HTML file:</p>

<pre><code>$(document).ready(function() {
$('#submit').click(function() {
var username = $('input[name=username]');
var password = $('input[name=password]');
var firstName = $('input[name=firstName]');
var lastName = $('input[name=lastName]');
var userNamee = $('input[name=userName]');
var password = $('input[name=password]');
var secretQuestion = $('input[name=secretQuestion]');
var secretAnswer = $('input[name=secretAnswer]');
var phone = $('input[name=phoneNumber]');
var email = $('input[name=email]');
var data = 'username=' + username.val() + '&amp;password=' + password.val() + '&amp;firstName='     + firstname.val() + '&amp;lastname=' + lastname.val() +
'&amp;userName=' + userNamee.val() + '&amp;password=' + password.val() + '&amp;secretQuestion=' +     secretQuestion.val() + '&amp;secretAnswer=' + secretAnswer.val() +
'&amp;phone=' + phone.val() + '&amp;email=' + email.val();

.ajax({
url: "login.php",
type: "GET",
data: data,
cache: false,
success: function() {
alert("SUCCESS");
}
});
return false;
});
});
</code></pre>

<p>This works when I test in a browser but not as an APK on Android.</p>

<p>I also get the values in PHP:</p>

<pre><code>$username = ($_GET['username']) ? $_GET['username'] : $_POST['username'];
$password = ($_GET['password']) ? $_GET['password'] : $_POST['password'];
</code></pre>

<p>How can I get my PHP files working correctly on the android device so my PHP files call my server correctly?</p>

<p>Thanks</p>
