1 回答

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超10個(gè)贊
有幾種方法可以做到這一點(diǎn):
使用 PHP 的
header('Location: /page-url');
$_POST
如果設(shè)置則渲染不同的內(nèi)容
<?php
if (isset($_POST['submit'])) {
// Set Global Session Variables from Form's POST Values
$_SESSION["favcolor"] = $_POST['favcolor'];
$_SESSION["favanimal"] = $_POST['favanimal'];
// Render other page content
include "session2.php";
// end the script to prevent loading this page contents
die;
}
?>
<form action="" method="post">
Enter Color: <input type="text" name="favcolor" /><br />
Enter Animal: <input type="text" name="favanimal" /><br />
<input type="submit" value="submit" name="submit" />
</form>
通過 AJAX 請(qǐng)求提交表單并根據(jù)響應(yīng)進(jìn)行重定向
- 1 回答
- 0 關(guān)注
- 122 瀏覽
添加回答
舉報(bào)