PHP - Moved: Username Validations In Php And Ajax
This topic has been moved to Ajax Help.
http://www.phpfreaks.com/forums/index.php?topic=323416.0 Similar Tutorials
Using Inline Php; <h1><font Color="000088">the Username <?php '.$username.' ?> Already Exists";</h1>
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=318572.0 ISSUE. A User enters information into a form. If the 'username' is already taken, a 'message' in Red and with larger font-size will be returned, for example, "The username $username already exists." If the username is 'mattd' then the message should say, "The username mattd already exists." Within my php application, I have included 'inline html'. Here is part of the code: .... if (mysql_num_rows($query_run)==1) { // it will never = more than one because only //one user will or will not exist ?> <html> </body> <h1><font color="#FF0066">The username <?php echo $username; ?>already exists.</h1> </body> </html> <?php }else{ //start the registration process $query = "INSERT INTO `Names` VALUES .... 1. At one point I did get this: "The username mattd already exists." 2. But now I only get "The username already exists." I am not retrieving the $username variable. This screenshot is found he http://imgur.com/lIwLZ1G thanks. While we're on the subject, is there a way to ensure that the first letter of a name is captalized, and the rest lowercase? Or is this best handled later on, when the name is being used and called from the DB. PS: some of us comment are code as to WHAT we are doing because we're just not that good yet, and we need to explain it to ourselves. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=333348.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=312841.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=351379.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=325858.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=332473.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=314220.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314117.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=319274.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=308756.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=350592.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=320161.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=323434.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=347835.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=348693.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=309753.0 Hi Guys I'm pretty new to PHP, and I've taken on a small PHP project. My project has (among other things) a page where you can capture/edit users. This involves entering a user name and password on an HTML POST form. Upon submitting the form, the data is set to a php script that writes it to a MySQL database. My problem is this - I need to validate the data before writing it to the database. I have to check that all required fields have values, that the "Password" and "Confirm Password" fields match and that the user did not enter illegal characters (SQL injection). Where should this happen? The script can validate the data, but then I'll still need a way to send the user back to the form and repopulate it automatically with what the user had entered. I can't use GET parameters (due to having to keep the password private). One way of doing it might be to send everything except the password as GET parameters, and force the user to re-enter the password. Am I missing something here? What's the best way of doing validations? Thanks for your input. Cheers, Riaan This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=353182.0 |