What are the differences between sending data via POST and GET methods in PHP and how does it impact security?
When sending data via POST method in PHP, the data is not visible in the URL and is sent in the request body, making it more secure for sensitive information. On the other hand, when sending data via GET method, the data is visible in the URL, which can pose security risks as it can be easily intercepted and manipulated.
<form method="post" action="process_form.php">
<input type="text" name="username">
<input type="password" name="password">
<button type="submit">Submit</button>
</form>