sprucepinedesign Posted March 7, 2010 Share Posted March 7, 2010 I am doing the web site for a magazine, and the client wants users to have to type in their name and email address before they get access to the online version of the publication. I know how to password protect pages using .htaccess, but this would be a little bit different. I want the users name and email address to serve as the password, (and then this information is sent to client). After the name and email are submitted, users are allowed to visit the page that contains the magazine content. I don’t want them to have to enter their name/email each time they visit the site, only the first time. Perhaps for subsequent visits a cookie could “remember” that the user has already provided their name and email address? Anyone know a script that can do this? Please reply here or send email to chad#sprucepinedesign.com (replace # with @). If I posted this in the wrong forum let me know and I will re-post in appropriate place. I am new here and did the best I could to find the correct thread to post in... Chad Link to comment https://forums.phpfreaks.com/topic/194445-script-to-collect-information-allow-access/ Share on other sites More sharing options...
Anti-Moronic Posted March 7, 2010 Share Posted March 7, 2010 It's fairly simple to do this. But you *will* have to have a login form should a cookie not be present otherwise they would have to sign up again with a dif username and/or email just to create that cookie. Here's what you do: -) have a register form where the user enters their username and email -) make sure you send a confirmation link to their email so you know you have a real, active email address -) once the user is confirmed - on that confirmation - create the cookie and have it last for 3 years or some other large amount of time. -) redirect to the magazine That's it. Then, if a cookie does not exist for somebody who is trying to access the magazine - you will *have* to feature a login form. If you don't you are just alienating visitors and making it extremely inconvenient to interact with the site. Later, you can build in a forgot username function etc. etc. to make it more convenient, but that's the general gist of it. Link to comment https://forums.phpfreaks.com/topic/194445-script-to-collect-information-allow-access/#findComment-1022790 Share on other sites More sharing options...
sprucepinedesign Posted March 7, 2010 Author Share Posted March 7, 2010 That's great advice! Thank you. What's a good code to do this... Link to comment https://forums.phpfreaks.com/topic/194445-script-to-collect-information-allow-access/#findComment-1022803 Share on other sites More sharing options...
Anti-Moronic Posted March 7, 2010 Share Posted March 7, 2010 To be honest, you need something a little custom. You could search google for 'php login script' and then adapt that to your needs but I feel you should develop this from scratch. It is quite a simple job, would only take around 4 hours. Link to comment https://forums.phpfreaks.com/topic/194445-script-to-collect-information-allow-access/#findComment-1022805 Share on other sites More sharing options...
sprucepinedesign Posted March 7, 2010 Author Share Posted March 7, 2010 I don't know how to code PHP at all. Do you know of anyone that might do this for me at a reasonable cost? Link to comment https://forums.phpfreaks.com/topic/194445-script-to-collect-information-allow-access/#findComment-1022808 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.