php register form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
method_man
Forum Contributor
Posts: 257
Joined: Sat Mar 19, 2005 1:38 am

php register form

Post by method_man »

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?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: php register form

Post by Roja »

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?
Break it into tasks:

- 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

Post by method_man »

could you please give me an example of using the mail() function?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

Code: Select all

mail($to, $subject, $message, $headers);
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

I recommend using PHPMailer There are examples on the following link:

http://phpmailer.sourceforge.net
Post Reply