get is designed for scripts which you want people to be able to bookmark the url with all the get variables
I would have to disagree with this. GET is used for a variety of purposes other than that one use above. Look at how it is used on this site for instance. At present, my url looks like:
http://www.phpbuilder.com/board/newreply.php?s=&action=newreply&threadid=10273907
You wouldn't bookmark this, it's just so users don't have to click buttons, use forms etc, but see neat and tidy links.
Any, by default, any information that you want to submit securely should indeed be sent via an https connection (SSL). Also, it's advisable to use md5 encryption for variables such as passwords, and all these should definately be passed on via $_POST[] as although not particularly secure, it saves information such as passwords etc being seen in the url by people peeping over others shoulders. 😉
Anyhow, use $GET[''] for simple tasks such as telling the script what to do, in one of my scripts I have script.php?a=delete&id=1 for example. Use $POST[''] to submit user information, such as the field that I'm currently writing, ha, this "post" 🙂 into.
MD5 encryption example:
$password = md5($password);
Now let's assume you wanted to perform a check against the password thats encrypted into the database and the password the user has submitted:
// Write the sql code here
// Now continue...
$submittedpassword = md5($_POST['password']);
if($submittedpassword == $password) {
// Code here
} else {
// Die statement e.g.
die("Sorry, wrong password.");
}
Ok, that was a very rough version, it could be improved against SQL Injection etc.