/    Sign up×
Community /Pin to ProfileBookmark

adding information to a database

Ok i need some major help.

these are the form feild i would like people to eneter.

Email*
Verify Email*

Password*
Verify Password*

User Name*
Film Studio Name*

Film Studio Logo (w: 150px – h: 100px)

First Name*
Last Name*

Gender*
Year of Birth*

Address 1
Address 2
Zip/Post Code
City
State/Province (US and Canada only)
Country*

the ones marked with a * must be entered.

now how do i verify someone email and password, when the enter them twice how do i make sure there the same.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@JonaMar 05.2004 — [font=arial]Let's assume your email field is named, "email," your confirmation email field (the second one) is named, "cemail," your password field is named, "pass," your confirmation password field (the second one) is named, "cpass," and that you're using the POST method...[/font]

[code=php]
/* Basic validation to ensure that the fields are not empty and do not have just spaces in them. No PHP code that comes after this part will run if one of the fields is left empty. */
if(isset(trim($_POST["email"])))
{$email = $_POST["email"];}
else{exit;}
if(isset(($_POST["cemail"])))
{$cemail = $_POST["cemail"];}
else{exit;}
if(isset(($_POST["pass"])))
{$pass = $_POST["pass"];}
else{exit;}
if(isset(($_POST["cpass"])))
{$cpass = $_POST["cpass"];}
else{exit;}

/* Ensure that the two email fields match, if they do not, all PHP code will stop running after displaying a message. */
if($email != $cemail)
{echo("The email fields do not match."); exit;}

/* Ensure that the two password fields match, if they do not, all PHP code will stop running after displaying a message. */
if($pass != $cpass)
{echo("The password fields do not match."); exit;}
[/code]


[font=arial]You might want to look into using regular expressions for extensive validation. This will only validate if the field is empty or not, so users could put anything as their email address, as long as it isn't empty, and it will say it is valid.[/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@chris9902authorMar 05.2004 — I already have my script that does that i was just unsure about how to check to see if there the same. looking at that makes me think PHP will be alot quicker to learn then i first thought. thanks very much.
Copy linkTweet thisAlerts:
@JonaMar 05.2004 — [font=arial]No problem. By the way, you might want to look into taking a few tutorials, if you haven't already. ?[/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@chris9902authorMar 05.2004 — i got some book i am going to read over the next week. i am hoping to have all this in my brain by the summer
×

Success!

Help @chris9902 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...