davhill Posted August 14, 2013 Share Posted August 14, 2013 Hello All,Ultra-newbie and PHP extra-virgin here, with a grovelling apology if this is the wrong bit of the forum.I'm building my new site in Dreamweaver, but I have a 'test' site up on Yola. The site is a pay-to-enter 'museum' and I'd like it to work like this...Punter clicks on PayPal button, goes to Paypal and pays (a paltry sum).Punter is taken to my 'Lobby' page from which he/she can access all the site's pages.After a set time (say, 24 hours), the punter loses access to the site.So here's what I'd like to have PHP do...Paypal tells the site of the purchase.I get a notification with the punter's info (e.g. who, where, when + mail address).PHP uses the Paypal info to send a 'thanks for calling' e-mail.Punter is taken to the Lobby pageHe/she can swill about in the site but the timer's running, and blocks access after 24 hours.This will become clear after a look at the test site. It's at www.dead-interesting.co.uk To get past the PayPal page for a look around, fill in the username value as 'admit' and the password as 'one'...(no quotes).Think 'Sideshow'Just as an aside, I'm not a developer and so respond to the K.I.S.S. principle. I don't even know where PHP scripts go.Be gentle with me Quote Link to comment Share on other sites More sharing options...
sKunKbad Posted August 15, 2013 Share Posted August 15, 2013 Since you want to use Paypal, you should look at their IPN API. IPN stands for Instant Payment Notification. The notification can be sent to your website, where you intercept it and use the data in it to update your database. The data in the IPN should contain the email address of the site visitor, so you would use that as their user name to login, and you would send them an email with the password. Since I trust that site security is not extra critical, giving the site visitor the password through email is probably acceptable. Now that the user can log in, they would have access to the logged in area, until their access expires, which is something you would put in the database when you first get the IPN. So, you're going to get a little experience with the IPN API, whatever database you choose to use, and whatever Auth library you choose to use. If you use a PHP framework that already has an authentication library, then the rest is probably pretty easy. Quote Link to comment Share on other sites More sharing options...
Zane Posted August 15, 2013 Share Posted August 15, 2013 I remember doing that exact thing (listing out processes) before I ever learned PHP. I had just reached a firm enough grasp on HTML, but still relied on WYSIWYGs. What I am getting at is that even though you claim Just as an aside, I'm not a developer and... doesn't mean you cannot learn it. Visualizing the processes like you have done in your OP is a good indicator that you have an analytic and systematic mindset Nevertheless, you still admit to not knowing anything about PHP nor programming nor HTML but rather only Dreamweaver. Listing out a set of processes like that... ?? Imagine you were an engineer and someone randomly came to you because they noticed you were not busy and asked you "How would I construct a machine that wakes me up in the morning, brushes my teeth, wipes my ass, and drives me to work?" I'll be honest, it's hard to "be gentle" with you about such a question. If you're looking for a kick in the right direction then just say so. Don't be that person that uses someone as a paintbrush for their ideas and doesn't pay the person. My only answer to you is to either create a post in the Freelancing section or buy a decent book on PHP and follow along with it, asking questions along the way as you need to. I recommend any PHP book by Julie Meloni, but then again, that's only PHP book I ever had...if you don't count this community/forum Quote Link to comment Share on other sites More sharing options...
davhill Posted August 15, 2013 Author Share Posted August 15, 2013 Thank you, gentlemen, sKunKbad: PayPal developers' largely useless help system has mention IPN and API with a MySQL database. I quote their later response to my Q... 'Unfortunately, we do not have any script examples to do what you are wanting to do. If you do not know how to do that you will need to seek the help of a developer, as we are not in a position to help you develop this solution.' Thanks, guys It looks like that's probably the way to go, though someone else has mentioned that the timed access thing might work with a cookie sent to the user's machine. Zane: I appreciate your response, thank you. I learned my HTML a long, long time ago, using (would you believe) MS Frontpage. I tried building another site using it and submission wiped out 75% of the code - it's all changed since the early days. So, consider me as an HTML Newbie and a PHP virgin if you like. Sorry, but I rather resent the implications in your post, especially, ""How would I construct a machine that wakes me up in the morning, brushes my teeth, wipes my ass, and drives me to work?". I didn't ask anything of the sort. I don't need a kick in the right direction, I'm, simply trying to learn about where the right direction lies. I don't need to be told how to employ someone. If you can come up with a better way of getting the info I need with *no* budget, please feel free. Just FYI, I don't hold the lofty position of moderator anywhere. I have, however, been an author/journalist for 27 years; I've worked on all manner of British classic cars, and have been a photographer for more than 40 years. If anyone asks me about any of these areas, I will answer questions, to the best of my ability...and politely. Thank you for your input, if not for your opinion. Quote Link to comment Share on other sites More sharing options...
jcbones Posted August 15, 2013 Share Posted August 15, 2013 Davhill, look into the IPN API, they do have scripts for what you are looking for. You need to focus on, 1. Submitting payment 2. have paypal call a script on your site 3. your script notifies paypal you received the notification, and updates your database at the same time. They do have an example script of that. The number 3 script could also fire off the email. paypal can also return the client to 3 different pages, 1 for payment failed, 1 for payment canceled, and 1 for payment complete. So you can set your lobby for the payment complete. From here, there is thousands of ways you could go, but that should get you started. PS. Please don't grade my writing, I've only been doing it a couple years Quote Link to comment Share on other sites More sharing options...
Zane Posted August 16, 2013 Share Posted August 16, 2013 (edited) I'm, simply trying to learn about where the right direction lies.[...]If you can come up with a better way of getting the info I need with *no* budget, please feel free.I suppose I shouldn't have been so aggressive in my response. There are a lot of people who ask the same types of questions every day, but yours grabbed my attention because you actually had a logical order of things you wanted to happen. If no budget means that you are excluding books on this subject then I would turn to Google. You have already been answered as far as what kind of web-based technologies can accomplish your described goal. IPN. IPN (Instant Payment Notification) would be the right direction. You can google those three letters alone and get more than enough helpful results, not to mention the very first one, that is not an advertisement, brings you directly to Paypals IPN information page. You're also seeking tutelage on that technology, so append tutorial to IPN. IPN is the only way you will achieve such things. As jcbones pointed out, Paypal allows you to have data sent to three different scripts (or pages as jcbones put it). There lies your answer. Then of course is the handicap of "complete newb." That is a tough handicap to deal with when it comes to answering your questions effectively or with any integrity whatsoever. My advice is to take those three letters and dive head first into tutorials on the matter. Hello World examples and a lot of copying a pasting will get you started. I suggest you read this so you can wrap you head more around the idea. http://www.geekality.net/2011/05/28/php-tutorial-paypal-instant-payment-notification-ipn/ Just FYI, I don't hold the lofty position of moderator anywhere.I've never been called lofty until now. If that is the case, I didn't intend to come off as lofty. A small blue rectangle doesn't make me any different or special in any way. In my opinion it just expresses that I have been here for quite a while and have seen my fair share of questioning patterns all the while. Dig into all the IPN tutorials and examples you can find. Do not expect Paypal themselves to help you at all. It is not their job to do so and I doubt that any Paypal personnel that you do manage to communicate with will even know about development and logic. Paypal has their own personal IT team and they are not going to share it. P.S. Frontpage was also my weapon of choice back in the day. I was a table making maniac. Edited August 16, 2013 by Zane Quote Link to comment Share on other sites More sharing options...
davhill Posted August 17, 2013 Author Share Posted August 17, 2013 Thank you, Zane, this is more the kind of info I was seeking. Thanks also to jcbones. My apologies if I came across as snappy. No excuses and I think we've crossed that bridge I've put a few sites together. They work but I want this one to look (and feel) more professional. So, I'll be following your comments, advice and links. Another ex-Frontpage user? Know the feeling However, I don't recall CSS being there then , but I do remember WYSIWYG in FP wasn't too accurate. Thanks again guys - I'll be back when I get stuck Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.