$_POST is returning null

111
December 30, 2018, at 07:50 AM

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

Answer 1

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

Rent Charter Buses Company
READ ALSO
MYSQL-Got different result when use sum(case when condition 1) and count(case when condition 1)

MYSQL-Got different result when use sum(case when condition 1) and count(case when condition 1)

I used the following query to count row I wonder when I use sum() in the query it returns correct but when I use count return falseI complete that work but I need this clarification for further development of myself

124
how to Replace date with mysql query

how to Replace date with mysql query

I need a MySQL request to replace the DATE data typeBut when I use where this query doesn't work

126