作为问题,我可以$_SESSION在下面的代码中做到这一点,但我想在不使用的情况下做到这一点$_SESSION,有什么建议吗?我是在 php 中使用 oop 的新手。
PHP(第 1 页):
include './class.php';
include './next.php';
if(isset($_POST['submit'])){
$data = new myData();
$data->setTest($_POST['test']);
}
$content = '<form method="post" action="next.php">
<input type="text" name="test" id="test" value="test"/>
<input type="submit" name="submit" value="Submit"/>
</form>';
if(!empty($next)){
$content = $next;
}
echo $content;
类.php:
class myData{
function __construct($test){
***some process***
$_SESSION["test"] = $test;
}
}
下一个.php
$next = $_SESSION["test"];
qq_遁去的一_1
翻阅古今