目前我的想法是网站只有一个公共入口。公共入口调用其所属的控制器对HTTP请求进行判断。。
如果存在参数e,则根据参数e来转入其他的入口
目前出了个问题。。如何通过程序来将$_POST里的参数转发给这个入口呢?例子
index.php(公共入口)
<?php>
require "control/ctr_AllFront.php";
isset($_POST["e"])&&$entry=$_POST["e"];
$c=new AllFront($entry,$_POST);
<?>
公共入口的控制器ctr_AllFront.php
<?php>
class AllFront{
public function __construct($entry,$request){
$classfile = $entry. '.php';
if(!is_file('../entry/'. $classfile)){
(这里该怎么写才能把$_post里的东西转发给Login.php呢?)
}
}
}
<?>
功能性入口Login.php
<?php>
(这里该如何接收传过来的参数呢?)
<?>望大侠解答
如果存在参数e,则根据参数e来转入其他的入口
目前出了个问题。。如何通过程序来将$_POST里的参数转发给这个入口呢?例子
index.php(公共入口)
<?php>
require "control/ctr_AllFront.php";
isset($_POST["e"])&&$entry=$_POST["e"];
$c=new AllFront($entry,$_POST);
<?>
公共入口的控制器ctr_AllFront.php
<?php>
class AllFront{
public function __construct($entry,$request){
$classfile = $entry. '.php';
if(!is_file('../entry/'. $classfile)){
(这里该怎么写才能把$_post里的东西转发给Login.php呢?)
}
}
}
<?>
功能性入口Login.php
<?php>
(这里该如何接收传过来的参数呢?)
<?>望大侠解答
解决方案 »
- php登录msn确认身份验证服务器。。。。
- 请大家介绍几款免费给PHP加密的工具。无时间限制的那种
- 怎么限制上传的文件只能是wav格式?
- 困扰多天的PHP+XOOPS的安装问题,未解决
- 怎么使用javascript来判断输入的电子邮件是否合法?
- php乱码
- 要使用session,对PHP.ini要进行哪些设置?
- 下拉菜单的问题
- 我安装php,配置一下apache里面的httpd.conf就OK,没有php.ini,怎么安装ZendOptimizer啊
- php网页存在乱码,求各位解决,谢谢了
- PHP找私活
- select Max(RootID) from news_class 如果表中没有记录,则返回什么?
curl
fsockopen
fopen
file_get_contents
我GOOGLE了一下。。据说有2种方法来模拟发送php的POST请求,。。
一种是使用curl中的一些函数;
一种是使用fsockopen()打开一个socket连接,并设置header头来完成模拟POST请求
想问下大侠们,那种方法会更好一点呢?有没有能够传送一下经验的大侠~~~
(这里该怎么写才能把$_post里的东西转发给Login.php呢?)
}
里使用就可以了?
index.php(公共入口)
<?php>
require "control/ctr_AllFront.php";
isset($_POST["e"])&&$entry=$_POST["e"];
$c=new AllFront($entry,$_POST);
<?>
公共入口的控制器ctr_AllFront.php
<?php>
class AllFront{
public function __construct($entry,$request){
$classfile = $entry. '.php';
if(!is_file('../entry/'. $classfile)){
header("HTTP/1.1 301 Moved Permanently");
header("Location:entry/".$classfile);
}
}
}
<?>
功能性入口Login.php
<?php>
var_dump($_POST);
<?>
这样写输出的是array(0){}
看来只能转发并模拟post请求了
如何做比较好呢
看这个帖子地回复!
为什么用header? 直接 include / require 即可另: 除唠叨外,别的回帖都没明白楼主要干什么