₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,106 members, 8,438,823 topics. Date: Saturday, 04 July 2026 at 03:33 AM

Toggle theme

Php Json Help - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingPhp Json Help (647 Views)

1 Reply

Php Json Help by Taiw(op): 12:16pm On Jul 09, 2015
I am trying to create a login system using json like this $data_string = '{"email_address":"'.$semail.'","device_type":"WEB","password":"'.$spass.'","action":"signin"}';

I am using jQuery AJAX Call to PHP Script with JSON Return in a .js file i have. The problem i have is i dont want it to return json in ajax. i want to be able to decode my json return from php.

The problem lies in the ajax
$.ajax({
type: "POST",
dataType: "json",
url: "ajax.php",
data: data,
success: function(result){
// alert(result.responseCode);
if (result.responseCode == 'X1') {
// alert(result.responseMessage);
window.location.replace('index.php');
} else {
// Display result.responseMessage
alert(result.responseMessage);
}
}

I noticed extra lines of codes wont work in my php file. So i am looking for a way to post this without the success method
Re: Php Json Help by spikesC(m): 1:31pm On Jul 09, 2015
Am a little bit confused but are you trying to build Json data from the form input and send it to php?

If it's so then that is quite unnecessary. Just do a regular post/get to php and return Json from php to Ajax
1 Reply

Jamb Past Questions API In JSONProgramming Challenge: Convert String to Json with a LoopList Of All States With Local Governments In Nigeria In JSON, PHP And SQL Format234

Machine Learning.Programming Folks ... How's D Lockdown Going??? What Are Your Challenges???Looking For Collaborations On Any Project