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 420147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:50:50+00:00 2026-05-12T18:50:50+00:00

Basically I will tell you what I want to do. 1: If a user

  • 0

Basically I will tell you what I want to do.

1: If a user is not logged in I want them to be re-directed back to the login page.

2: If a user is Logged in and they submitted a form I want them to be directed to the next page.

I have tried it with meta refresh but I can only seem to get it working with one or the other.

Can you please advise what the best way to do this would be ?

the code I am using at the moment is

<meta http-equiv="refresh" content="0;index.php">  
<meta http-equiv="refresh" name="myidentifier" content="0;mystats.php">  

Thanks

  • 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-05-12T18:50:51+00:00Added an answer on May 12, 2026 at 6:50 pm

    Use http headers instead. For example:

    session_start();
    
    //Redirect when user is not logged
    if($_SESSION['logged'] != 1)
    {
      header("Location: http://redirect.here.com/login.php");
      exit(0);
    }
    
    //Redirect when user sent form
    if((isset($_POST['sent']))&&($_SESSION['logged']==1))
    {
      header("Location: http://redirect.here.com/nextpage.php");
      exit(0);
    }
    

    Don’t forget to set $_SESSION['logged']=1 after successful login.
    There are more methods of detecting that user sent form, but I prefer placing hidden input field with name="sent" to each form.

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

Sidebar

Related Questions

I have a page that will basically be used to concatenate a bunch of
Basically multiple instances of our application will be launched but they need to have
Basically I want to make simple toggle program (that will be mapped to some
Basically, I want to have a list of links, where each link will show
I'm writing an app that will basically be like Fraps, but it will push
I'm running a loop basically that will make an array that contains a million
I'm trying to write a very lightweight build script which will basically just get
I'm working on an algorithm that manipulates pictures. Basically I will implement a diffusion
I need some help choosing databases for my application. My web application will basically
The criteria is basically this: folders will exist for about 24-48hrs folders names can

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.