JSON and JSONParser Error -- Register and Login
I just finished adding in a AsyncTask to my RegisterActivity.java and
LoginActivity.java to help deal with a ANR error, which has seemed to
work. Now, when I run the code I get a JSON and JSONParser error. I get
this error when I tap the "Register" or "Login" button on my user login
interface. Here is the LogCat:
09-04 18:13:39.776: E/JSON(854): <?xml version="1.0"
encoding="UTF-8"?>n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">n<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">n<head>n<title>Object not found!</title>n<link rev="made"
href="mailto:postmaster@localhost" />n<style
type="text/css"><!--/*--><![CDATA[/*><!--*/ n body { color: #000000;
background-color: #FFFFFF; }n a:link { color: #0000CC; }n p, address
{margin-left: 3em;}n span {font-size:
smaller;}n/*]]>*/--></style>n</head>nn<body>n<h1>Object not
found!</h1>n<p>nnn The requested URL was not found on this server.nn
nn If you entered the URL manually please check yourn spelling and
try again.nn nn</p>n<p>nIf you think this is a server error, please
contactnthe <a
href="mailto:postmaster@localhost">webmaster</a>.nn</p>nn<h2>Error
404</h2>n<address>n <a href="/">10.0.2.2</a><br />n <span>Apache/2.4.2
(Win32) OpenSSL/1.0.1c PHP/5.4.4</span>n</address>n</body>n</html>nn
09-04 18:13:39.776: E/JSON Parser(854): Error parsing data
org.json.JSONException: Value <?xml of type java.lang.String cannot be
converted to JSONObject
09-04 18:13:39.786: E/LoginTask(854): No login response was received
I am using PHP and connecting to a local server (phpmyadmin) to hold my
database values (i.e. username, password, email, ect.) I am using XAMPP,
and I made sure that both Apache and MySQL were running. I am connecting
my Android to the database via phpmyadmin by php API classes as in this
tutorial:
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Any help would be appericated. Thanks!
No comments:
Post a Comment