javascript within php not working!
Posted: Sun Feb 22, 2009 12:46 am
dear all,
i need to make javascript code within if statement in php so that when a user session is over, he will be redirected to another page! its not working and there is no error! the one i am talkting about is bold and underlined. thanks for the help.
code:
i need to make javascript code within if statement in php so that when a user session is over, he will be redirected to another page! its not working and there is no error! the one i am talkting about is bold and underlined. thanks for the help.
code:
<?php
session_start();
if ($_SESSION['timeout'] > (time() - 60))
{
echo "You are logged in.";
}
else
{
echo "Your session has timed out.";
//echo '<script type=\"text/javascript\">';
//echo 'window.location="http://islam4everyone1429.net/authanticate/sorry.php"';
//echo '</script>'; }
if (!isset($_SESSION['db_is_logged_in'])
|| $_SESSION['db_is_logged_in'] !== true) {
// not logged in, move to login page
header('Location: http://islam4everyone1429.net/authanticate/sorry.php');
exit;
}
?>
<html>
<body>
<p>This is the main application page. You are free to play around here since you
are an autenthicated user</p>
</body>
</html>