English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am designing a website using php. I want some part of the site to load only once. That is, lets say, after a member made his payment, he wil be redirected to the registration page. Without his payment effected, he wont be able to access this page. Now that he has paid, he will be able to access the registration page. But as soon as he performed registration and click on submit. I dont want him to be able to access the page again, either by using the link or the BACK button. How do i do this? Can anyone help me??

Serious answers only please. If its beyond your knowledge, move on, I want the answers to be well detailed.

Thanking you in advance.

Regards

2006-09-27 07:39:49 · 2 answers · asked by Nadeem 2 in Computers & Internet Programming & Design

2 answers

if you add these headers to the page you don't want the user to load:
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, no-store, must-revalidate");

This will cause the browser of the user to refresh the page instead of reload from cache when the user clicks the back button. You can then add checks to redirect the user as needed.

2006-09-27 07:47:30 · answer #1 · answered by John J 6 · 0 0

I think your best bet is to use php sessions. Then, after the user has filled out the registration, you can session his view of that page as yes, then create a script in your registration page to find out if the sessioned user has been to the registration page already. If he has, echo an error.

http://us3.php.net/manual/en/ref.session.php

or, put a column in your registration table, if you're using one, and mark it either yes or no when the user registers and then write a script for your registration page checking that table column.

2006-09-27 14:46:27 · answer #2 · answered by rob 3 · 0 0

fedest.com, questions and answers