What alternative methods can be used to pass variables between PHP files besides using GET?

When passing variables between PHP files without using GET, alternative methods include using POST, sessions, cookies, or including files directly.

// Using POST method
// File 1: sending data
<form action="file2.php" method="post">
    <input type="hidden" name="variable_name" value="variable_value">
    <input type="submit" value="Submit">
</form>

// File 2: receiving data
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $variable = $_POST['variable_name'];
    // Use $variable as needed
}
?>