PHP - I Can't get the $_POST Values on Ajax RequestBy Hardik Savani | March 18, 2016 | | 1912 Viewer | Category : PHP jQuery AngularJS Ajax
Share this post:
I want to share this posts with you because when i was working on native PHP and Ajax Post request(Specially AngularJS Post request) at that time i can't get Post value on form submit. That's why i would like to share you this post. I also want to tell you i was working on my Ubuntu 14.04. I did try lot but i can't get value.
At last find stuff to how to solve this issue, i did use "file_get_contents('php://input')" that way i could get POST value in json object and i also decode json value using "json_decode()". So let's try this way :
$post = file_get_contents('php://input');
$post = json_decode($post);
$sql = "INSERT INTO items (title) VALUES ('".$post->title."')";
$result = $mysqli->query($sql);
- Laravel 5 - Multiple markers in google map using gmaps.js
- Laravel 5.2 - User ACL Roles and Permissions with Middleware using entrust from Scratch Tutorial
- How to check file size when select multiple file validation using Jquery?
- Laravel 5 generate sitemap using roumen/sitemap package Example
- How to upload image with validation in PHP Codeigniter?
- How to remove all whitespace from string in JQuery?
- How to create blade view file using command line in Laravel?
- How to add prefix in each key of PHP Array?