I am creating a mobile version of my application . This is a part of the settings page (mysettings.php).
if(!isset($_SESSION['access_token']))
{
echo("<script type='text/javascript'> window.top.location.href='http://www.example.com/mobile/login.php'</script>");
}
If the access_token is not set then it should redirect to the login.php but i cant understand why isnt it working.
In the rendered source code I can see because the redirection is not occurring is ( The redirection code exists )
<script type='text/javascript'> window.top.location='http://www.example.com/mobile/login.php'</script>
<!DOCTYPE html>
<html>
<head>...
.
.
.</html>
I am using Chrome and this is source code from where I am logging to mysettings.php page
<?php
session_start();
$logins=0;
?>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Settings</h1>
</div><!-- /header -->
<div data-role="content">
<div class="ui-grid-a">
<div class="ui-block-a"><a href="mysettings.php" data-role="button" data-mini="true">Settings</a> </div>
<div class="ui-block-b"><a href="my.php" data-role="button" data-mini="true">My Pictures</a> </div>
</div>
</div><!-- /content -->
<div data-role="footer">
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>