How to fetch single data without using GET method in PHP?|EasyCoding45

 How to fetch single data without using GET method in PHP?

Answer:--

                You can fetch Single data from HTML page to PHP page by Using POST method as well.

Example :--

  • This is Our HTML File named as "senddata.html".

<html>

<head>

<form method=post action="getInput.php">

Enter Number:<input type=text name=num><br>

<input type=submit value=submit>

</head>

</html>

  • This is Our PHP File named as "getInput.php".
<?php
$number=$_POST['num'];
echo "Number is :$number";
?>

  • Note :--
  1. This is the Second Method in which you can fetch data from PHP without using GET method.
  2. $_POST :- It is used to fetch data from HTML page.
  3. $_POST provides more security then $_GET method.






Comments