I am working first time with PHP and Http Post method. I have written a PHP script and running it on WAMP server. I am testing this script using the Advanced Rest Client for chrome. Following is my PHP script
<?php
var_dump($_POST);
$m = new MongoClient();
$db = $m ->tododb;
$collection = $db->tasks;
$title = $_POST['title'];
$description = $_POST["description"];
$priority = $_POST["priority"];
$status = $_POST["status"];
$tmp = array(
"title" => $title,
"description" => $description,
"priority" => $priority,
"status" => $status
);
$collection->insert($tmp);
echo "success";
?>
But i am getting error in my response. For every index variable in $_POST "Undefined Index" error occurs. Further, on doing var_dump on $_POST i found that the array is empty. Can someone please tell me what is wrong with my code and/or Post request. Screenshot of erroraneous response