PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 19th, 2003, 10:35 PM
ATL_bones ATL_bones is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: ATL
Posts: 5 ATL_bones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP Security :: URL access control

I'm trying to set up a secured page using PHP that can only be accessed after a visiter has paid using PayPal. Basically, this is what would happen:

1. a user would choose a subscription on Server A.
2. user would be redirected to PayPal
3. on "success" PayPal will refer back to a page on Server A where a user can fill out a form and submit information into MySQL DB

I wouldn't want someone to reach step 3 without paying due to the garbage that could end up in the database. What can I do to prevent that since I am redirecting to PayPal and then being pulled back to my site?

I understand that $_SERVER["HTTP_REFERER"] is a bad idea, and it's too unpredictable anyway. What are some alternatives? Has anyone encountered anything like this?

Thanks in advance. I'm pulling my hair out here...and I don't have much to spare

Reply With Quote
  #2  
Old December 20th, 2003, 04:30 PM
ATL_bones ATL_bones is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: ATL
Posts: 5 ATL_bones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Will $_SESSION variables last if you leave your domain and come back based on clicks, etc.? I know it won't if you type the address in manually...

Reply With Quote
  #3  
Old December 22nd, 2003, 08:21 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
In my experience with Paypal, I've been given a button to add to my site. It included hidden parameters named "return" and "cancel_return" in which I could specify urls for Paypal to redirect to. Perhaps you could append session ids or something to these URLs to validate the return link against. Or on page load, generate an md5 hash that you send along with the return/cancel URL. You'd stick this hash in your database on page load as well. The return page would check the hash passed against those in the database and do additional tasks as needed. You'd also need a pruning cron script to clear out old hashes. This isn't fully secure or anything, obviously.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP Security :: URL access control


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT