FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


verifying email id's by sending verification link to email





rinujohn
Please help me to code this problem..I'm a newbiew to php and would like to know how php mail works.Concepts common techniques used in websites etc.....
Manofgames
http://uk.php.net/manual/en/function.mail.php

There's the mail() function.
Usually registration scripts will create a random key, insert the user's details into the users table, setting a field (usually called status, or active) in the table to 0.
They then send the user an email using the above function, which contains a link to a script that will activate their account.

The script will then search the database for the user, and if they're inactive, it will check the registration key against the one in the database (so that they have confirmed they really do own that email address) then if both keys are the same, it will set the users' status field = 1 so that the user can login.
If the user is already active, it won't bother doing the above.

The login script will search for any users with that username, that password and who are active ( = 1).
If it finds a user, then it logs them in else, it tells them they've got some details wrong.
ammonkc
Manofgames wrote:


There's the mail() function.
Usually registration scripts will create a random key, insert the user's details into the users table, setting a field (usually called status, or active) in the table to 0.
They then send the user an email using the above function, which contains a link to a script that will activate their account.

The script will then search the database for the user, and if they're inactive, it will check the registration key against the one in the database (so that they have confirmed they really do own that email address) then if both keys are the same, it will set the users' status field = 1 so that the user can login.
If the user is already active, it won't bother doing the above.

The login script will search for any users with that username, that password and who are active ( = 1).
If it finds a user, then it logs them in else, it tells them they've got some details wrong.


Another thing that you might consider is creating a temporary table to hold the inactive user's info. then once the user clicks on the activation link copy that info into the *real* db table. this would help to keep the overhead down in the database. if you insert all the user's data into the main production db, spammers and users who register with fake emails, could potentially create a huge overhead in your db.
Related topics
HELP! I registered, but never got my confirmation email.
Use gmail space & features for any email addr
20+ gigs IMAP email invites for sale
Longest domain name in the world!
30 Gigs invites for just 0.5 frih$
EMAIL NOTIFICATION!!!
Paypal E-Mail Scam
tweaking wordpress
Adding field to message data
Email Question
who is mohammad? the prophete of islam
Page Based Email Issue
Free .info Domains Names (LIMITED TIME OFFER)
Recovering Yahoo Account!!!
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.