• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

User Registration : PHP + MySQL

Peter Shadeslayer

New member
Okay, heya!

I'm trying to make a user registration script... not really sure how. I know I haven't cleaned up the input any, but here's what I have so far. If I use html entities and mysql_real_escape_string on this and use the whole isset() thing, will it work?

PHP:
$query = "INSERT INTO users (user, password, usergroup, email, regdate) 
values('".$_POST['user']."', '".$_POST['password']."', 'user', '".$_POST['email']."', CURDATE()";

I'm also not sure how the CURDATE() function works...
 
Just run it to see if it works. :/ As for the security measures, as long as you've run mysql_real_escape_string on the username, password and e-mail address, it should be as safe as you're going to get with PHP as far as I know.
 
Back
Top Bottom