调用索引.php从另一个索引.php不同的目录
call index.php from another index.php of different directory
/school
/teacher
index.php
/student
index.php
如何从teacher/index.php
拨打student/index.php
?
在你的
老师/索引中.php写
header("Location: ../student/index.php"); // this is incase you want to go to that page
require_once('../student/index.php'); // incase you want to include that file
require '../student/index.php';
这将"调用"脚本。如果脚本具有返回值,则只需在 require 语句的左侧创建赋值语句即可。
$ret = require '../student/index.php';
在你的teacher/index.php
顶部使用此代码
header("Location: ../student/index.php");
您还可以
使用pecl_http(如果可用(和函数http_redirect。
http://php.net/manual/en/function.http-redirect.php
相关文章:
- 尝试在PHP中回显输入文本时出现未定义的索引错误
- 传递给 PHP 表单时 JavaScript 动态变量上的未定义索引
- 使用ajax时,php中未定义的索引
- “未定义的索引:itemdetails”,当将JSON对象从JavaScript发送到PHP时
- 未定义的索引-表单不通过javascript将值发送到php代码
- 尝试使用AJAX将JavaScript变量传递给PHP,但得到'未定义的索引'
- PHP表单适用于索引,但不适用于联系我们页面
- 如何判断字符串中字母的索引?(在Python、JS、Ruby、PHP等中)
- 为什么php找不到JSON发送的索引
- PHP的原因注意:未定义的索引:
- PHP未定义的索引(由jquery文件上传引起)
- 如何删除cookie错误注意:PHP上的未定义索引
- 同时使用索引.html和索引.php时,从 URL 中隐藏索引.php
- Ajax / PHP 注意:未定义的索引:
- 带有PHP(未定义索引)的Youtube API V3 GET横幅图像
- Javascript FormData 索引在 PHP 中读取结果时会发生变化
- 调用索引.php从另一个索引.php不同的目录
- Magento主页仅在索引.php上存在冲突
- 包括头php文件到我的索引php文件-没有错误产生
- 如果使用 jquery 进行会话检查在后台失败,如何重定向索引.php页面