Jump to content

Re: Validation Pt. 1


ChompGator

Recommended Posts

Hello,

 

A while back I posted a topic about how to create a validation link off a join form. The script I recieved - was useful, but not versatile enough. So I was hoping for some more help, and this time Ill be more specific, but I want to do this in two parts so I can make sure I understand how to do it.

Part 1 is as follows:

 

Say, I have a join form - and when you submit the join form, I already have a handle.php (a script to handle the form) made, and I already have it - so that the values from the form get inserted into a database. But there are a few things I cant master, so the form works. The trouble is, I want a validation link - sent to the user's email address they provided, but once they click the validation link - I want them to automatically get another email from our server with their ID Number (which should be automatically assigned) and their password (which they will provide on the join form)  so they can login to the site.

 

Now, more or less, I need to know a script that will not only send a validation link on submission, but also how to get it so when they click the link - they get sent their ID, and Password.

 

Anyone have any scripts that do this, or know where I could get a good tutorial on how to do this?

 

Link to comment
Share on other sites

writing something like would be pretty easy i would think..

 

Review the following for setting up code to send an email...

http://us3.php.net/manual/en/function.mail.php

 

Review the following for creating random "stuff"...

http://us3.php.net/manual/en/function.rand.php

 

 

in the message that gets send ( email ) include a link with the activation stuff...  of which should be done before the email is sent.  First store all your stuff from the reg form. then take either the name or a username and use that for an identifier on the activation link and store this in a seperate table ( i do ) along with a random set of characters.  Then on the page the link goes to do a search on the user name and see if the code matches... if so activate the account ( send another email) and move on...

 

example link

 

http://www.yoursite.com/activate.php?name=bob&code=879f897n43fn9873498n7f3457

 

 

Link to comment
Share on other sites

Hmm, Ill review it - Do you think it might be easier to use Captcha Validation instead?

 

Not that this can't work, its just this looks pretty complex, and Im not that well versed in php, I mean Im not a BAD php programmer, but I would not say that Im overly experienced either you know, I know a good amount about it, but when looking at this, it looks like it can get severly complex, is that right?

 

 

Link to comment
Share on other sites

i have never used Captcha personally but that would work for making sure, or trying to make sure that its an actual person submitting the form.

 

The difficulty depends on how you look at it...  break it down into simple steps...

 

get email sending... any email

get new table set up to store the codes... heres a quick example.

CREATE TABLE IF NOT EXISTS `activation_codes` (
  `act_id` int(11) NOT NULL auto_increment,
  `act_username` varchar(255) NOT NULL default '',
  `act_code` varchar(50) NOT NULL default '',
  `act_date` int(11) NOT NULL default '0',
  PRIMARY KEY  (`act_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;

 

get the insert to put the new code into above table on a submit ( new register )

create activate page which link will go to and do a search on the database and confirm information...

Link to comment
Share on other sites

If you want I'll make available a game I started writing a while back but never finished. This contains I believe exactly what you want to do - sends a user an email containing a validation link which must be clicked to activate the account.

 

If you're interested let me know and I'll check my web space and upload it if it isn't there already.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.