目前我的想法是网站只有一个公共入口。公共入口调用其所属的控制器对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>
(这里该如何接收传过来的参数呢?)
<?>望大侠解答

解决方案 »

  1.   

    就是请求就可以了.
    curl
    fsockopen
    fopen
    file_get_contents
      

  2.   

    $_POST 是全局型变量,无需在函数(方法)间传递,只需在需要时使用即可
      

  3.   

    自己占个沙发,顺便补充一下问题。
    我GOOGLE了一下。。据说有2种方法来模拟发送php的POST请求,。。
    一种是使用curl中的一些函数;
    一种是使用fsockopen()打开一个socket连接,并设置header头来完成模拟POST请求
    想问下大侠们,那种方法会更好一点呢?有没有能够传送一下经验的大侠~~~
      

  4.   

    是不是直接在if(!is_file('../entry/'. $classfile)){ 
    (这里该怎么写才能把$_post里的东西转发给Login.php呢?) 

    里使用就可以了?
      

  5.   

    还不如用webservice来做。。搞得这么复杂。。
      

  6.   

    再次补充一下。刚刚试了一下
    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请求了
    如何做比较好呢
      

  7.   

    http://topic.csdn.net/u/20100112/13/2604a386-0b38-4f70-b4a7-f89062c63e49.html
    看这个帖子地回复!
      

  8.   


    为什么用header? 直接 include / require 即可另: 除唠叨外,别的回帖都没明白楼主要干什么
      

  9.   

    本意不想require入口界面的刚刚仔细想了想,好像如果不是require那公共的单一入口也没什么用了好像