corrupshun Posted January 6, 2010 Share Posted January 6, 2010 So what i have so far on the login script checks to see if the information posted is even set, if it's empty, and if the password is the password confrimation. It's still very basic and has no login characteristics. I checked over the code for an hour at school (study hall) (irrelevant ) and cannot find the problem. (the code is below) <?php if(isset($_POST['username']) && isset($_POST['password']) && isset($POST['password2']) && isset($_POST['email'])) { if(!empty($_POST['username']) && !empty($_POST['password']) && !empty($POST['password2']) && !empty($_POST['email'])) { if($_POST['password']==$_POST['password2']) { //&& (strlen($_POST['username'])<=20){ $password = md5('$_POST[password]'); $date = date('F d, Y'); $username = $_POST['username']; $email = $_POST['email']; echo "$username $email $password $date"; echo strlen("$username"); } else { echo "passwords do not match"; } } else { echo "One or more fields are empty."; } } else { if(!isset($_POST['submit'])) { echo "Signup Here"; } } ?> <html> <form name="register" action="register.php" method="POST"> Username<input type="text" name="username" /><br /> Password<input type="password" name="password" /><br /> Confirm Password<input type="password" name="password2" /><br /> Email-Address<input type="text" name="email" /><br /> <input type="submit" value="Register!" name="submit" /> </form> </html> My second question is what I would like to add soon. I looked over the filter_var() function on w3schools and didn't see anything for what i wanted. for the username I only want to allow the following: (A-Z),(a-z),(0-9),dashes, underscores, periods, and spaces. How would I check to see that? I would do the regex stuff, which is probably the way to go, but i have NO clue how do use it Quote Link to comment Share on other sites More sharing options...
corrupshun Posted January 6, 2010 Author Share Posted January 6, 2010 oh WOW i forgot to say what was wrong well, after i type all the post stuff and submit it, it does nothing, when it should post the information. 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.