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

  • Home
  • SEARCH
  • 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 8019781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:29:40+00:00 2026-06-04T21:29:40+00:00

I have a secured site using ssl. I have a php file that checks

  • 0

I have a secured site using ssl. I have a php file that checks the login and if you are not logged in it brings up a login form, once you log in the page refreshed and the login is checked again and when it passes it loads the page content. What i am trying to do is have it load the login in https then when the javascript gets the ok from ajax that the login was successful, the page is reloaded with just http to reduce the load time and latency of the page (these are large pages and any little thing will help). I need to do this dynamically, so i can not just give it a redirect url.

  • 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-04T21:29:43+00:00Added an answer on June 4, 2026 at 9:29 pm

    To solve this problem you can use this untested psuedo code loaded at the top of every page you require a login on.

    if(loggedin()&&$_SERVER[SERVER_PORT]==443)
    { 
       //if user is logged in but they are still on the https site, redirect to the http site
        header("Location:http://$_SERVER[HTTP_HOST]$_SERVER[SCRIPT_NAME]?$_SERVER[QUERY_STRING]");
    }
    elseif(!loggedin()&&$_SERVER[SERVER_PORT]!=443)
    {
        //if the user is not logged in and they are not on the secure site,  send them to the login page on the secure site
        header("Location:https://$_SERVER[HTTP_HOST]/login.php");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ASP.NET MVC 2 and have a login page that is secured via
I have a file on a secured site I would like to download using
I have an MVC site, secured using [Authorize] attributes, but have an issue on
I have a website which allows secure (ssl) file uploads and download. The site
I have been trying to post login credentials to an https site using cURL
Iam trying to login to a https secured site using Apache commons httpclient. Iam
I have a site which in ssl but i am not able to secure
My site has https sections (ssl), and others are regular http (not using ssl).
Imagine that you have a simple site with only 2 pages: login.aspx and secret.aspx.
I have a load balanced dev site that I'm working out bugs for SSL

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.