make a page unaccessable until credit card validation?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chris12295
Forum Contributor
Posts: 113
Joined: Sun Jun 09, 2002 10:28 pm
Location: USA
Contact:

make a page unaccessable until credit card validation?

Post by chris12295 »

Ok, i have a site for people to place ads online. I want them to be able to put their ad in my database but not until they pay. How can I prevent them from accessing a script to insert their information until their payment has been validated? I dont have a script started so, any suggestions would work.
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Post by Jim »

Well, you could always do it manually.

I can't think of any way PHP will be able to tell if the Cred Card is verified unless you tell it so. So when you see the cred is improved, just slip the banner into rotation! :D
chris12295
Forum Contributor
Posts: 113
Joined: Sun Jun 09, 2002 10:28 pm
Location: USA
Contact:

Post by chris12295 »

I dont need a credit validation or banner rotation script, i just need to prevent the script from being accessed unless a user has paid bascially. I think it might have somthing to do with file locking or chmod but im not sure. CAN ANYBODY HELP ME???? :cry:
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I think what Jim meant was accept their information but flag it until the payment has been authorised. If the payment isn't authorised or they don't pay within a specified time period you delete their info. If their credit card goes through fine you unflag the info and the banner goes live.

Or you could have it so you need a username and password to login to an admin area where ad details can be added and the username and password are sent out when their card is validated.

Mac
chris12295
Forum Contributor
Posts: 113
Joined: Sun Jun 09, 2002 10:28 pm
Location: USA
Contact:

Post by chris12295 »

the second part is more what i need, but how can i set up a login or admin area so people cant access the pages until they have logged in?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Basically you need to have a database or flat file with usernames and passwords stored in it. Then you have a login screen like you do for things like this forum, which requests that data. You then compare the users info with info in the database and if you get a match the person is then allowed into the secure area. The script to test for logged in status is included at the top of each page that needs to be secure.

A fully coded example of a login script using a database is available here:
http://www.evolt.org/article/Creating_a ... index.html

Mac
Post Reply