PHP - I Can't get the $_POST Values on Ajax RequestBy Hardik Savani | March 18, 2016 | | 1687 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);
- Autocomplete with images and custom html code in Jquery UI?
- PHP Codeigniter - Ajax Infinite Scroll Pagination Example
- How to create Event for Mail sending in Laravel 5.2?
- Solved - fatal: Failed to connect to bitbucket.org port 443: Network is unreachable
- Laravel 5 dropbox api file upload example using league/flysystem-dropbox package
- How to get current url with query string in codeigniter?
- Laravel Jquery Ajax Pagination Example From Scratch
- How to retrieve number of twitter followers count without authentication or api ?