比如我在Index.php里定义变量$hack_aaa=mt_rand(80000,304913);,然后写了一个index.htm的静态文件,想在这个文件里调用$hack_aaa这个变量,意思就是把index.htm跟Index.php联系起来

解决方案 »

  1.   

    执行的机器不同,联系只能通过post或者get
      

  2.   

    如果Index.php里没有输出代码的话,那么index.htm直接include这个index.php就可以引用$hack_aaa了,如果Index.php有输出,那么把这个$hack_aaa写到另外一个文件中,大家都include这个文件就可以了
      

  3.   

    为什么非得是静态的htm,加入php代码获取$hack_aaa不行吗?
      

  4.   

    I think you should use ror(ruby on rails), I think it is very fit for you.
    this problem can be solved by using Ajax, but you still could use the variable $hack_aaa
    you can only get this value by javascript. that's all
    [email protected]