Last updated Oct 26, 2011
Dear developer...
What you need to store (and compare upon login) is only a hash (a checksum), which can never be reversed back to the original password. And keep in mind:
Email is being transmitted (and usually stored) in PLAINTEXT, and therefore EVIL. This wouldn't even be possible in the first place if you sticked to rule #1, but even just mailing the password in a confirmation email (directly after creating a user account, without saving the password yourself) is FORBIDDEN.
And your 'I forgot my password' feature should not email a new password, but a time limited link through which the user can submit a new password themselves, once.
User input is ANYTHING that directly or indirectly originates from outside your server. Get and Post variables, uploaded files, external files, remote scripts, form input, email, cookies, session IDs, browser agent strings, HTTP requests, URI formats, referrer URLs, ANYTHING.
This also implies that JavaScript, which runs client side, by definition can NOT secure anything. Using JavaScript to avoid illegal or invalid input is merely a user-friendly feature that helps them entering correct input. It does NOT avoid illegal or invalid input to be submitted, in any way. Anyone can override your script and submit whatever he/she/it (in case of bots) likes.
Therefore:
Enforce SSL (https) for your login page. And while you're at it, you might just as well enforce SSL for your entire website. Hardly any reason not to, any so called performance issues are remnant illusions of a previous decade.
Whenever there's ANY personal or sensitive information involved on your website (like a login form, registration process, acquiring customer details, email subscription, cookies, history, banking, payment, administration area, whatever), why making it possible for your customer's ISP, or secret government agencies, or a wifi hotspot operator, or man-in-the-middle hackers, or whoever, to sniff your traffic, monitor or intervene with your customer's connection, keep track of your communication, and whatnot?
JUST. USE. SSL.
Oh, and FYI: regular plain old-fashioned FTP is also COMPLETELY INSECURE as it transmits all login details, commands, and file data in PLAINTEXT (amongst other weaknesses). So just like email, FTP is EVIL and should be avoided whenever possible. Any decent hosting provider should provide a secure alternative such as SFTP.