$success = "Your comment has been added";
$_SESSION['success'] = $success;如果我之后回音,它就设置好了,一切都好了
现在,我将用户重定向到相同的URL
header("Location: http://mydomain.com/post/?post=". $url_from); // send back此url调用此函数
<?php
fetch_for_inside($_SESSION['success']); // I pass the success session to the function
unset($_SESSION['success']); // unset
?>所有其他内容都是在函数中重新创建的,然后我在函数中创建了这些内容
if (isset($success_session)) {
echo '
<div class="info">
'. $success_session .'
</div>
';
};这是在函数中,并且该函数确实会得到
function fetch_for_inside($success_session)作为参数,但变量是空的吗?
我知道
<?php session_start() ?> on http://mydomain.com/post/?post=". $url_from
并且我在函数中执行此操作
发布于 2013-03-10 11:31:26
在启动会话之前未设置变量$_SESSION。所以一定要打电话给
<?php session_start() ?>https://stackoverflow.com/questions/15318495
复制相似问题