Jump to content

Protecting action pages


ballouta

Recommended Posts

So you have chained forms? I'd recommend using sessions to work out where each user is and what information they should be filling in.

 

If you're new to sessions, you might like to check out this tutorial: http://www.phpfreaks.com/tutorial/sessions-and-cookies-adding-state-to-a-stateless-protocol

You can also do something like this at the top of all of your action pages.  Its not 100% secure (hardly anything is ;-) ) but it does the trick for the basic guy manually typing it in the address bar..

 

<?php

if ($_SERVER['PHP_SELF'] == "/register.php")
{
	echo "<meta http-equiv=\"REFRESH\" content= \"0;url=http://www.YourHomePage.com\">";
	die();
}

?>

 

OR you could just put the processing portion of "register.php" in a different directory and include it in parts of the processing..

<?php
require_once "/home/yourDirectory/includes/register.php";
?>

 

Then you could have the code in a different directory (outside of your web space) to prevent anyone from ever directly accessing the code.

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.