dubking India
dubking India

Reputation: 35

$_POST is returning null

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

enter image description here

Upvotes: 0

Views: 78

Answers (1)

Aravindh Ravichandran
Aravindh Ravichandran

Reputation: 77

Adding Content-Type as application/x-www-form-urlencoded in request header should solve the issue I guess.

Upvotes: 1

Related Questions