Jump to content

[SOLVED] Accessing a page only 1 time ?


thryb

Recommended Posts

Good day freaks!

Im currently on a litle webpage project and I would like to know if there is a way that I can block someone to reaccess the page I redirected too after they go by paypal.

 

Lets say it goes that way : Paying by paypal -> Redirected to the form they have to fill -> Submit to add stuff to DB (at this point since they saw the name of the page they were on Id like to block the access cause I dont want they to be able to fill the form again) -> Redirected to the main page.

 

If anyone as any idea please let me know cause Im trying to figure out and I cant find anything

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/66157-solved-accessing-a-page-only-1-time/
Share on other sites

Sessions or cookies...

 

you could say for example:

 

if ($_COOKIE['this_page'] == true)
{
   //do with them what you will if the cookie is set
}
else
{
   setcookie("this_page",true); //set the cookie so that you know they have been on that page.
}

 

or you could use sessions :)

 

but thats what i would do :)

But Then Its Not Very Safe Is It

 

Because The Cookie Can Be Deleted

Or You Can Just Block All Cookies So The Cookie Can't Even Be Set In The First Place

 

 

DataBase = Good | Session/Cookie = Bad

 

And how is a database more secure? Using a database implies that the user will have to log in so that you can determine who they are first before determining whether to show them the page or not (Assuming the OP is already using a database). What prevents them from creating a new account? No matter what solution is chosen it would be a simple matter to defeat.

 

Most users do not delete their cookies and I would choose that method as well based upon the scarce information provided by the OP. If more details were provided I might suggest a different approach.

I thought about the database too, but that would mean (like mj said) that the user has to login, and I want something really simple. Cookie seems like a good idea.

 

Is there a way to completly remove the /thispage.php so the user can only see www.this.com

Kinda like the index.php or htm when you first enter.

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.