| | |
Please Help Me Fix My PHP Register Form
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
PHP Syntax (Toggle Plain Text)
<?php if(isset($_POST['register'])) { $username = $_POST["username"]; $password = $_POST["password"]; $email = $_POST["email"]; $conf_pass = $_POST["confirm"]; $error = false; $connect = mysql_connect("localhost", "stickmi1_data", "electricCompany"); $database = mysql_select_db("account", $connect); $usernameCheck = mysql_query("SELECT username FROM users WHERE username = '$username'"); // Registration Form Validation Script if(!$username || !$password || !$email || !$conf_pass) { $error = true; $errorMessage = "Please fill in any missing fields before continuing!"; } else if($password != $conf_pass); { $error = true; $errorMessage = "Your password and confirmation password don't match!"; } if($usernameCheck > 0) { $error = true; $errorMessage = "The requested username is already in use, try another!"; } if($error == false) { $password = md5($password); mysql_query("INSERT INTO users(username, password, email) VALUES($username, $password, $email)",$connect); } } ?> <form name="register_form" method="post"> <table> <tr> <td>Username: </td> <td><input type="text" name="username" /></td> </tr> <tr> <td>Password: </td> <td><input type="password" name="password" /></td> </tr> <tr> <td>Confirm Pass: </td> <td><input type="password" name="conf_pass" /></td> </tr> <tr> <td>Email: </td> <td><input type="text" name="email" /></td> </tr> <tr> <td><input type="submit" name="register" value="Register" /></td> </tr> </table> </form>
Last edited by Ezzaral; 30 Days Ago at 4:54 pm. Reason: Added code tags. Please use them to format any code that you post.
-1
#2 30 Days Ago
1. Please use [code][/code] tags to post your code.
2. Tell us what the problem is, I for one would not want to read your code and then guess at the problem.
2. Tell us what the problem is, I for one would not want to read your code and then guess at the problem.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
![]() |
Similar Threads
- Inserting data to mysql database using php created form (MySQL)
- Php register user and later authenticate user (PHP)
- problems with php web form (PHP)
- PHP Contact form (PHP)
- PHP Contact Form Help (PHP)
- PHP Quote form (PHP)
- php login form (PHP)
- php mail form - need to redirect to new page (PHP)
Other Threads in the PHP Forum
- Previous Thread: preg_match validation
- Next Thread: a Function that is not working...
| Thread Tools | Search this Thread |
.htaccess ajax alerts apache api array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database date display dynamic echo email emptydisplayvalue error errors explodefunction file files folder form forms function functions google hack href htaccess html htmlspecialchars image include insert integration ip java javascript joomla keywords limit link login loop mail menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect regex remote script search securephp server sessions shot sms soap source space sql subscription syntax system table tutorial update upload url validator variable video web xml youtube





