Jump to content

Disabling Browser Cache and Redirecting


tstout2

Recommended Posts

Hey all!  I currently use ASP for most of my pages, but I am working with an application that is in PHP.  I need some help protecting my index.php as i have been doing with my ASP files, so can someone help me translate the following ASP code in the PHP equivalent?

 

Thanks so much for any help!

 

Current ASP code:

 

<%@LANGUAGE="VBSCRIPT"%>
<% Option Explicit %>
<%    
    'This page will not be cache by the browser (security reason)!
      Response.CacheControl = "no-cache"
      Response.AddHeader "Pragma", "no-cache"
      Response.Expires = -1

    'This will make sure no user can access this page without login into the system first,
    'If the user type this page address directly into the browser, they will be redirected into the login page!

      If Session("name") = "" Then
         Response.Redirect("index.asp")
      End If
%>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.