【发布时间】:2018-04-03 06:56:07
【问题描述】:
考虑下面的代码,让我知道如何在 PHP 中使用全局帖子。 虽然我通过在两个地方复制代码来运行此代码,但我需要访问已经编写的代码。
我有一个文件abc.php:
if (isset($_POST['test'])) {
return 'hello test1';
} elseif(isset($_POST['test2'])){
return 'hello test2';
} else {
return "test3";
}
现在我有另一个文件efg.php:
if (isset($_GET['hello'])) {
//Here, I need content from abc.php
}
/* More code... */
如何将 POST 从一个页面传递到另一个页面?
【问题讨论】:
-
欢迎来到 Stack Overflow!提问时请更具体一点:您的实际问题是什么? / 您期望什么? / 您会遇到什么错误? 如需帮助,请查看“How to ask”
-
这是一个低质量的问题。试图清除意图。
标签: php post global-variables