ChompGator Posted December 7, 2007 Share Posted December 7, 2007 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? Quote Link to comment Share on other sites More sharing options...
ikmyer Posted December 7, 2007 Share Posted December 7, 2007 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 Quote Link to comment Share on other sites More sharing options...
ChompGator Posted December 7, 2007 Author Share Posted December 7, 2007 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? Quote Link to comment Share on other sites More sharing options...
ikmyer Posted December 7, 2007 Share Posted December 7, 2007 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... Quote Link to comment Share on other sites More sharing options...
revraz Posted December 7, 2007 Share Posted December 7, 2007 If you search a bit, you can find a complete Registratrion Tutorial on how to use email validation. Quote Link to comment Share on other sites More sharing options...
ChompGator Posted December 7, 2007 Author Share Posted December 7, 2007 Fantastic, this concludes my part 1, I will let you guys know of any progress, or problems I have, Im going to try and have it working tonight, my part two, has to do with sessions and access levels, - But that will come later! Thanks again! Quote Link to comment Share on other sites More sharing options...
revraz Posted December 7, 2007 Share Posted December 7, 2007 Plenty of tutorials on those also Quote Link to comment Share on other sites More sharing options...
Yesideez Posted December 7, 2007 Share Posted December 7, 2007 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. Quote Link to comment Share on other sites More sharing options...
ChompGator Posted December 10, 2007 Author Share Posted December 10, 2007 Please, yes, that'd help. 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.