PHP session problem
Below is my script :
if($redirect==1)
{
?>
<script>
setTimeout("gotoLink()",1000);
function gotoLink()
{
location.href='wycomments.php';
}
</script>
<?php
$_SESSION['BROADCAST_DOWNLOAD']=1;
}
?>
why i am not getting $_SESSION['开发者_运维问答BROADCAST_DOWNLOAD'] on wycomments.php
any help please.
Without seeing the whole code, it would seem that you are not calling
session_start();
in your php pages so that you can use the $_SESSION
object.
See session_start()
Are you sure about these things
- Have you started session in
wycomments.php
- Have you stated session in this code sample file
- What is the wrong if I put
$_SESSION
above the<script>
start
if($redirect==1) { $_SESSION['BROADCAST_DOWNLOAD']=1; <script> setTimeout("gotoLink()",1000); function gotoLink() { location.href='wycomments.php'; } </script> }
i think you unset the session so that you are not getting the result...
do session_start();
in wycomments.php
page
精彩评论