skendo Posted August 6, 2011 Share Posted August 6, 2011 i am trying to encrypt the password $password =md5($_POST['password']); but is not working why...? Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 6, 2011 Share Posted August 6, 2011 try this <? echo "Password - "; $password= 'abc123'; $password =md5($password); echo $password; ?> Password - e99a18c428cb38d5f260853678922e03 Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted August 6, 2011 Share Posted August 6, 2011 that does work... You need to encrypt it when a user is registering and again on the password they enter into the login form. Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 6, 2011 Share Posted August 6, 2011 try $_GET $password =md5($_GET['password']); Quote Link to comment Share on other sites More sharing options...
skendo Posted August 6, 2011 Author Share Posted August 6, 2011 sorry i am a beginner i am trying to make a module for a script that will make users signup So if is GET used wont it be for requesting data instead..?! Quote Link to comment Share on other sites More sharing options...
skendo Posted August 6, 2011 Author Share Posted August 6, 2011 thanks voip03 try $_GET Code: [select] $password =md5($_GET['password']); worked Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted August 6, 2011 Share Posted August 6, 2011 you should use $_POST for a password and any other user sensitive information. Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 6, 2011 Share Posted August 6, 2011 These words are mine; I am not sure how many people will agree it. POST -> to send the data GET -> get the date from URL Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 6, 2011 Share Posted August 6, 2011 When using HTML forms you can set the form method parameter to either "GET" (default) or "POST". So, which one to use? When working with GET method you can access all form variables with the $_GET array in PHP and when using POST you can access the variables using $_POST No matter which method used you can also access all variables using $_REQUEST array. When using GET all the submitted information is displayed in the address bar as part of the URL. You will see that as information shown after ? (called a query string), something like: http://domain.com/script.php?name1=value1&name2=value2 This can be useful for example where you want to be able to bookmark a page with specific query string values. However, the GET method is limited by the length of the URL (2083 characters in Internet Explorer according to Microsoft) and each of the input values must not exceed 100 chars. Obviously you also don't want to use GET when submitting sensitive information like passwords or credit card details as they would show up in the address bar. The POST method can send a lot of data (usually limited by the server settings) and should be used for every form unless the specific application benefits from the query string in the URL when using GET. No submitted data is shown in the address bar so most browser cannot correctly bookmark pages shown after a HTTP POST method. There you have it. Unless you need the query string that you get when using the GET method (and aren't effected by it's limits) you should use POST for your forms. If you are submitting any sensitive information that should not be displayed in the address bar the only way to go is with the POST method. http://www.tizag.com/phpT/postget.php http://www.phpfreaks.com/forums/index.php?topic=340484.msg1605098#msg1605098 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.