Ich habe das folgende HTML-Formular mit PHP:
<form name="login" action="http://oz-local.com:8080/_admin/login.php?action=process" method="post">
<input type="text" name="username" class="form-control" placeholder="Username"/>
<input type="password" name="password" class="form-control" placeholder="Password"/>
<button type="submit" class="btn btn-primary btn-block btn-flat">Sign In</button>
</form>
Wenn ich versuche, den Wert von „Aktion“ zu bekommen $_GET['action']
verwendet, ist es leer . Aber wenn ich $_REQUEST['action']
verwende, bekomme ich den Wert "process".
Das Skript, das ich für diesen Einsatz ist:
echo (isset($_REQUEST['action']) ? 'Yes': 'No');
echo '<br>R: ' . $_REQUEST['action'] . '<br><br>';
echo (isset($_GET['action']) ? 'Yes': 'No');
$gA = $_GET['action'];
echo '<br>gA: ' . $_GET['action'];
echo '<br><br>';
echo (isset($_POST['action']) ? 'Yes': 'No');
$pA = $_POST['action'];
echo '<br>pA: ' . $_POST['action'];
echo '<br><br>';
echo (isset($_COOKIE['action']) ? 'Si': 'No');
$cA = $_COOKIE['action'];
echo '<br>cA: ' . $_COOKIE['action'];
$method = $_SERVER['REQUEST_METHOD'];
echo 'M: ' . $method;
Ist es normal?
Das lässt mich nicht spüren !!
Jede Hilfe meine Zweifel zu klären ist gut
* "aber $ _GET ist es nicht" * - das ist normal, da Sie eine POST-Methode verwenden. –
@ user6184870 Bitte überprüfen Sie meine Antwort. –