Goodday,
I am facing a problem fetching send POST messages from postman on my local server. When i send an POST message the postman preview function prints my send data. However the webpage itself doesn't see the data and prints an error.
Here is my PHP script:
<head>
<title>PHP test page</title>
<h1>Number</h><br>
</head>
<body>
<?php
//$i = 0;
$data = $_POST["par"];
//while($data == ""){
//if($i == 0){
// echo "No data available";
//}
//$i = 1;
//}
echo $data;
//$page = $_SERVER['PHP_SELF'];
//$sec = "1";
//header("Refresh: $sec; url=$page");
?>
</body>
I am not experienced with this kind of stuff and am obviously missing something. Why does the data not appear on the webpage itself?
Greetings
On your webpage, you're probably not sending it as a POST request.
Try debugging:
var_dump($_POST); // Add this. $_POST probably doesn't have an index called "par"
$data = $_POST["par"];
echo $data
You need to POST "par" variable to this page.