Are there alternative methods to passing variables through URLs in PHP?

When passing variables through URLs in PHP, using query parameters is a common method. However, an alternative method is to use POST requests to send data to the server without exposing it in the URL. This can be achieved by submitting a form with method="post" or using AJAX to send data asynchronously.

// HTML form example
<form action="process.php" method="post">
    <input type="text" name="variable_name">
    <input type="submit" value="Submit">
</form>

// process.php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $variable = $_POST['variable_name'];
    // process the variable here
}