【发布时间】:2011-04-14 16:11:47
【问题描述】:
这是我正在构建的网站的结构:
我有 first.php,其中包括 second.php。
在 second.php 中,我有一个表单链接,并且我有 $_GET 来获取在此结构的最后一页发送的 url 参数。
form.php 告诉 action.php(这个结构的最后一页)switch case 是 FORM。 里面的表格我有:
header("Location: second.php?param1=OK¶m2=OK");
通过这一行,我加载了带有参数的 second.php 页面,但我需要加载的是 first.php 页面,包括 second.php 以及参数,因此我可以使用 $_GET
有什么办法可以做到吗?结构下方。
非常感谢!
first.php
I'm the first page<br><br>
<div style="width:500px;height:500px;border:2px solid red;"><?php include "second.php" ?></div>
second.php
<?php
$param1 = $_GET['param1'];
$param2 = $_GET['param2'];
?>
<script language="javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script>
$(document).ready(function(){
$("#theform").click(function(theevent){
$("#pre_target").html('<div id="target"></div>');
theform();
});
})
function theform() {
$("#target").load("form.php", {}, function(){ });
}
</script>
I'm the second page
<div id="pre_target">
<a href="#" id="theform">Go to form</a>
</div>
form.php
<form method="post" action="action.php">
<input type="hidden" name="ACTION" value="FORM">
<input type="submit" value="submit" name="submit">
</form>
action.php
<?php
switch($_REQUEST["ACTION"]) {
case "FORM":
header("Location: second.php#pre_target?param1=OK¶m2=OK");
break;
.
.
.
?>
【问题讨论】:
-
酷你建立一个
web?你是怎么做到的? :-p
标签: php jquery ajax html location