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 :--
- This is the Second Method in which you can fetch data from PHP without using GET method.
- $_POST :- It is used to fetch data from HTML page.
- $_POST provides more security then $_GET method.
Comments
Post a Comment