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
https://forums.phpfreaks.com/topic/189177-disabling-browser-cache-and-redirecting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.