Reputation: 35
I am getting null for all my posted data
below is my script
<?php
require "Constants.php";
if(mysqli_connect_errno()){
die('Unable to connect to database'.mysqli_connect_errno());
}
$ImageData = $_POST['ImageData'];
$profile_id = $_POST['profile_id'];
$ImagePath = 'eimg/'.$profile_id.'.jpg';
echo $ImagePath;
?>
in the above code $ImageData as well as $profile_id both are returning null
here is what i m sending
Upvotes: 0
Views: 78
Reputation: 77
Adding Content-Type as application/x-www-form-urlencoded in request header should solve the issue I guess.
Upvotes: 1