我向一个 PHP 页面发送了一个 POST 请求,根据其内容,我希望它返回我编写的两个独立 HTML 页面中的其中一个。
我向一个 PHP 页面发送了一个 POST 请求,根据其内容,我希望它返回我编写的两个独立 HTML 页面中的其中一个。
if ($_POST['param'] == 'page1' )
readfile('page1.html');
else
readfile('other.html');
这很简单
<?php
if($_POST['somevalue'] == true){
include 'page1.html';
}else{
include 'page2.html';
}
?>
只需包含相关页面
$someVar = $_POST['somevar'];
if ($someVar == xxxxx)
include "page1.htm";
else
include "page2.htm";
有很多直接实现的方法。您需要检查POST到PHP脚本的数据,并确定要呈现哪个HTML文档中的两个。
<?php
if (<your logical condition here>) {
include 'DocumentOne.html';
} else {
include 'DocumentTwo.html';
}
?>
<?php
if (<your logical condition here> {
header('Location: http://example.com/DocumentOne.html');
} else {
header('Location: http://example.com/DocumentTwo.html');
}
?>