What is the difference between using GET and POST in PHP forms, and how does it affect passing data in the URL?
When using GET method in PHP forms, the data is passed as a query string in the URL, which can be seen by the user and has a limit on the amount of data that can be sent. On the other hand, POST method sends data in the HTTP request body, which is not visible in the URL and can handle larger amounts of data securely.
<form method="post" action="process_form.php">
<input type="text" name="username">
<input type="password" name="password">
<button type="submit">Submit</button>
</form>