i am making a game called "Street Life" and i have made the register page but i dont know how to use php to actually have it do anything.
these are the things the registering person has to answer
First Name
Last Name
Email Address
Confirm Email Address
Sex
Date of Birth
(mm/dd/yyyy)
City
Country
how can i have it so it stores the things typed in in my database and sends an email to the person showing them all of the stuff they typed in and hav a random password that is 8 leters/numbers long?
php register form
Moderator: General Moderators
Re: php register form
Break it into tasks:method_man wrote: how can i have it so it stores the things typed in in my database and sends an email to the person showing them all of the stuff they typed in and hav a random password that is 8 leters/numbers long?
- Store things to a database: Look at the mysql_ functions, and SQL code including INSERT and UPDATE.
- Send an email: use mail(), or http://phpmailer.sourceforge.net
- Show them what they typed in: $_POST['username'], etc.
- Random password 8 characters long: Stolen from the php mt_rand user comments..
Code: Select all
for($len=8,$r='';strlen($r)<$len;$r.=chr(!mt_rand(0,2)?
mt_rand(48,57):(!mt_rand(0,1)?mt_rand(65,90):mt_rand
(97,122))));-
method_man
- Forum Contributor
- Posts: 257
- Joined: Sat Mar 19, 2005 1:38 am
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Code: Select all
mail($to, $subject, $message, $headers);I recommend using PHPMailer There are examples on the following link:
http://phpmailer.sourceforge.net
http://phpmailer.sourceforge.net