Php Json Help - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Php 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 |
Jamb Past Questions API In JSON • Programming Challenge: Convert String to Json with a Loop • List Of All States With Local Governments In Nigeria In JSON, PHP And SQL Format • 2 • 3 • 4
Machine Learning. • Programming Folks ... How's D Lockdown Going??? What Are Your Challenges??? • Looking For Collaborations On Any Project