HTTP protokolü vatansız, yani eski posta verilerini "hatırlayamaz". Ancak bir durumu simüle etmek için oturumu kullanabilirsiniz. nokta burada ne
<?php
session_start();
$_SESSION["oldpostdata"] = $_POST;
header("location:./setupDatos.html");
emin değil: böyle bir şey yaptığını deneyin. Bir html sayfası normalde herhangi bir sunucu tarafı işlem yapamazdı. .
setupDatos "html" "ileri" post verisi this question alınan etmek
<?php
session_start();
$oldPostData = $_SESSION["oldPostData"];
unset($_SESSION["oldPostData"]); // To only "flash" the data and not have it persist
$id = $oldPostData["Key"]; // Probably
Alternatif yol::
bununla birlikte sizin gibi eski sonrası verilere erişmek istiyorum mümkün olsaydı
<!DOCTYPE html>
<html>
<body onload="document.forms[0].submit()">
<form action="new-location.php" method="post">
<?php foreach($_POST as $key => $val): ?>
<input type="hidden" name="<?= htmlspecialchars($key, ENT_COMPAT, 'UTF-8') ?>" value="<?= htmlspecialchars($val, ENT_COMPAT, 'UTF-8') ?>">
<?php endforeach; ?>
</form>
</body>
</html>
HTTP protokolü durum bilgisizdir, bu nedenle ya bir önceki durumu "hatırlamanız" gerekir, ya da "header" ("Location: ./ setupDatos.html? OldVariable = $ value") ile birlikte iletmeniz gerekir. oturum, toplantı, celse. – apokryfos
@apokryfos Bu değeri html'den nasıl edinebilirim? –
@apokryfos Bağlantım, POST değil GET yoluyla –