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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:18:07+00:00 2026-05-20T18:18:07+00:00

So far, my HTTP_REFERER redirect script looks something like this on a page where

  • 0

So far, my HTTP_REFERER redirect script looks something like this on a page where the user can’t access (submit.php) until they login:

session_start();
 if(!isset($_SESSION['user_id'])) {
 header("Location: login.php");
 exit();
}

Which is fine, because, obviously if they try to go to submit.php, they need to login first. But once they login, they are taken to login.php again, since login.php was the last page they visited, instead of submit.php (which should be the correct page they are trying to get to).

This is only a problem for pages that aren’t shown until the user logs in. For example, if they go to /contact.php and then login, it will taken them right back to contact.php, but that is because it can be seen when they are logged out as well

  • 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-20T18:18:08+00:00Added an answer on May 20, 2026 at 6:18 pm

    I try not to use HTTP_REFERER gives me allot of headache most of the time.

    I would suggest saving the url to the session where they enter your application, so just before you redirect and check if they are authenticated. Then they will hit the login and forward them to the page saved in your session. Make sure you don’t save the login page if so redirect to the homepage or some other page.

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

Sidebar

Related Questions

What I found so far are some online resources like this: http://www.torsten-horn.de/techdocs/java-hibernate.htm (GER) https://www.hibernate.org/5.html
I have this so far: http://jsfiddle.net/26eVE/4/ I want that when the user clicks on
Okay so i set up this thing so that I can print out page
I have this so far: http://jsfiddle.net/u5vhS/54/ . What I want to be able to
http://pastebin.com/mYk8M038 here is what I have so far... I think it may be something
I got this far: :~ curl -u username:password -d status=new_status http://twitter.com/statuses/update.xml Now, how can
This is what I have so far: [my1@graf home]$ curl -# -o f1.flv 'http://osr.com/f1.flv'
I want to identify if a PHP script is being called inside an iframe
I'm working on a PHP contact form, but I can't get it to work.
i'm weak in regular expressions, i need to redirect any FileName.htm or FileName.html page

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.