dbz Posted December 2, 2009 Share Posted December 2, 2009 Hello! I'm a new php/javascript programmer. I have been building a site and I just created a user login page. Now I want to make a user signup page, and well- I would like to know how to do different types of validation to keep passwords secret. Ect. Any help from anyone would be greatly appreciated. I'm going to quote w3 schools: "Form Validation User input should be validated on the browser whenever possible (by client scripts). Browser validation is faster and reduces the server load. You should consider server validation if the user input will be inserted into a database. A good way to validate a form on the server is to post the form to itself, instead of jumping to a different page. The user will then get the error messages on the same page as the form. This makes it easier to discover the error." Well. I would like to be able to do some client side validations where possible, and like I said, I would really appreciate help. Thank you for your time! Quote Link to comment Share on other sites More sharing options...
KevinM1 Posted December 2, 2009 Share Posted December 2, 2009 That w3schools quote is a bit misleading, and a good example of why you shouldn't rely on them to learn anything other than some basic syntax. JavaScript validation serves one main purpose - to give the user better, more immediate feedback when they supply data to a website. It should never be considered the last line of defense as JavaScript can be turned off in the browser, rendering such validation completely worthless. Those with malicious intent know this, and will definitely try to exploit this innate weakness in JavaScript. Moreover, there are still non-threatening users who surf with JavaScript disabled for a variety of reasons. Server side validation should always be done because of this. And, since server side validation should always be done regardless of whether or not JavaScript is involved, there's no real server load benefit. The best way to do it is to use both simultaneously, using the same filtering rules on both sides to ensure nothing falls through the cracks. That said, is there anything specific you need help on? Have you written any code? Quote Link to comment Share on other sites More sharing options...
prasanthmj Posted December 2, 2009 Share Posted December 2, 2009 This JavaScript form validation script will be of help. Server side validations are mandatory as well. See: PHP form validation script Quote Link to comment Share on other sites More sharing options...
dbz Posted December 4, 2009 Author Share Posted December 4, 2009 Ah great! Thanks for those scripts. And yes. I have written a tiny bit of code. (Attached) I am about to make the registration form now. My attempt at learning javascript and php is writing these basic websites. For my specific help needs. I will need help with javascript very soon. (As soon as I finish the form and write the php(+sql) I will need hep designing (or writing) the UI (the javascript components that is) for the main part of the side. If I can get help now for the main UI though, I would be easily persuaded to spill my plans for how it should work and what it will do. [attachment deleted by admin] 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.