Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9196483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:51:35+00:00 2026-06-17T21:51:35+00:00

I am creating a mobile version of my application . This is a part

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:51:36+00:00Added an answer on June 17, 2026 at 9:51 pm

    You can use the header PHP function to perform a redirect:

    <?php
        if(!isset($_SESSION['access_token'])) {
            header("Location: http://www.example.com/mobile/login.php");
            exit;
        }
    ?>
    

    Note that this will need to be performed before sending any HTML markup

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a mobile version of my site, and at this point, creating an
I am creating a mobile version of my page where I have plugged a
I'm creating a mobile version of my site. There's a part of the site
I am creating a Facebook application that will integrate into a mobile version of
I'm creating mobile version of company site and I wonder if there is possible
I am creating a mobile application on Android that requires devices to communicate with
I am creating a mobile app using jquery mobile, PHP using JSON for fetching
I am creating a jQuery Mobile page that has two select menu's, one is
I'm creating mobile version of YouTube-like website. And i'm going to use Darwin Streaming
I am currently creating a mobile version of my company's site and using it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.