Hi,
Can someone point me toward a tutorial/script on how to do a user registration for protected pages and when they sign up send them an email with a link back to activate/verify their account.
TIA
user registration
Moderator: General Moderators
http://www.phpbb.com
http://www.invasionboards.com
go around and look at the source codes of boards.
they all do it
http://www.invasionboards.com
go around and look at the source codes of boards.
they all do it
the forums are shareware. you can dl them and look at their sources.
your only other option is to figure out what you want to do (which you have) and the (the rest of this you haven't)
break it down into part.
figure out what each part actually does.
figure out what php functions you need
write something to do each function
build up to what you want by getting the sub parts
here's some more help...
you want the user signup to end with a user needing to check their e-mail to verify, or to verify before they fill anything out.
what you need is a page that will collect a username and e-mail, generate a confimation code it'll somehow store, and then another one (or the same one) that verifies the code.
i'll help you walk through it from there as well as trouble shoot, but you need to do the following so i know you're learning as we go:
you need to tell me how you want this by produce one of these two things:
a set of pages that gets a username and email and either stores them in a database or textfile
one page that does that (yes, you can have one page for the entire site if you do it right. although i suggest otherwise. but for a sign up, i suggest making the entire signup one page. even if the user sees ten. why? it keeps what your doing together neatly)
your only other option is to figure out what you want to do (which you have) and the (the rest of this you haven't)
break it down into part.
figure out what each part actually does.
figure out what php functions you need
write something to do each function
build up to what you want by getting the sub parts
here's some more help...
you want the user signup to end with a user needing to check their e-mail to verify, or to verify before they fill anything out.
what you need is a page that will collect a username and e-mail, generate a confimation code it'll somehow store, and then another one (or the same one) that verifies the code.
i'll help you walk through it from there as well as trouble shoot, but you need to do the following so i know you're learning as we go:
you need to tell me how you want this by produce one of these two things:
a set of pages that gets a username and email and either stores them in a database or textfile
one page that does that (yes, you can have one page for the entire site if you do it right. although i suggest otherwise. but for a sign up, i suggest making the entire signup one page. even if the user sees ten. why? it keeps what your doing together neatly)
Thanks for your help.
I have found a tutorial that has most of the elements I am looking for.
You can see it here: http://www.phpfreaks.com/tutorials/40/0.php
although I would rather just use a textfile instead of a db to store user information. I'm sure I'll get stuck, not everything I need is there. Will post back when I run into problems.
THX!
I have found a tutorial that has most of the elements I am looking for.
You can see it here: http://www.phpfreaks.com/tutorials/40/0.php
although I would rather just use a textfile instead of a db to store user information. I'm sure I'll get stuck, not everything I need is there. Will post back when I run into problems.
THX!
actually. text files can become massive in size really quickly.
think about scalability.
that means how will this work for 10 people?
now how will it work for 10 million people?
things with good scalability wont need any code changes nor will they have much difference aside form say searching the user list. when you sign in
think about scalability.
that means how will this work for 10 people?
now how will it work for 10 million people?
things with good scalability wont need any code changes nor will they have much difference aside form say searching the user list. when you sign in
You need to remeber that the poster is new to this, hence learning about using text files is a very good start. Just because you have knowledge about something that is better, doesnt mean that everyone should use it.m3rajk wrote:actually. text files can become massive in size really quickly.
think about scalability.
that means how will this work for 10 people?
now how will it work for 10 million people?
things with good scalability wont need any code changes nor will they have much difference aside form say searching the user list. when you sign in
Perspective.
phoggy
I'd recommend http://www.hotscripts.com and of cource http://www.evilwalrus.com also. There you can find snippets that (hopefully) documented enough to learn from.
Hi guys,
m3rajk:
Didn't know that text files can become massive in size really quickly. The site I am planning is for a very specific community, and will probably to start off have no more than a couple of hundred users and max. thousand, so I guess that should still be ok.
JAM:
Checked out hotscripts, oh boy, lots of great stuff, don't know where to start
THX
m3rajk:
Didn't know that text files can become massive in size really quickly. The site I am planning is for a very specific community, and will probably to start off have no more than a couple of hundred users and max. thousand, so I guess that should still be ok.
JAM:
Checked out hotscripts, oh boy, lots of great stuff, don't know where to start
THX
JAM: that's good for extreme small scale.
a simple text firle (using notepadd) on windows, restricting each line (using a line per user) to 256 characters has a worse case senrio of going from 1k with no users to about 30k
1000 users would be 256k
that was restricked to 256 characters on one line.
seee how fast it goes?
add tot hat race conditions (if multiple ppl go for the same file)
there's built in functions for files as well as dbs. if you want to learn in a really useful way, you don't want to create something you'll have to adjust later, therefore you should look at something like that from the start.
that's why i brought it up.
phoggy: think about the worst case senario of what you want to hold (assume everyone will max out each piece of info)
jam and phoggy: think about checking usernames: dbs are better suited to handle that, you can have another feild for a unique id number or something like that. it's harder for text files (again, race conditions,you add up the firls then give it the next number, assume 3 ppl sign up at the same time......what happens?
they all read the number of files at the same time then go to creat ehte file. only one really gets created.... whoever writes last (the os WILL make sure of that) in the best case, or complete corruptionin the worst)
a simple text firle (using notepadd) on windows, restricting each line (using a line per user) to 256 characters has a worse case senrio of going from 1k with no users to about 30k
1000 users would be 256k
that was restricked to 256 characters on one line.
seee how fast it goes?
add tot hat race conditions (if multiple ppl go for the same file)
there's built in functions for files as well as dbs. if you want to learn in a really useful way, you don't want to create something you'll have to adjust later, therefore you should look at something like that from the start.
that's why i brought it up.
phoggy: think about the worst case senario of what you want to hold (assume everyone will max out each piece of info)
jam and phoggy: think about checking usernames: dbs are better suited to handle that, you can have another feild for a unique id number or something like that. it's harder for text files (again, race conditions,you add up the firls then give it the next number, assume 3 ppl sign up at the same time......what happens?
they all read the number of files at the same time then go to creat ehte file. only one really gets created.... whoever writes last (the os WILL make sure of that) in the best case, or complete corruptionin the worst)