note 83067 added to function.convert-uuencode

From: Date: Thu, 08 May 2008 16:42:35 +0000
Subject: note 83067 added to function.convert-uuencode
Groups: php.notes 
Request: Send a blank email to php-notes+get-139186@lists.php.net to get a copy of this message
Code snippet for Encoding passwords using convert_uuencode and store in mysql database . Consider a file named "test.php" consisting of an input form as given below: <html> <body> <form action="test.php" method="post"> <input type="text" name="fname" id="fname" /> <input type="password" name="password" id="password" /> <input type="submit" name="submit" value="submit" /> </form> <? /* below php code takes input field values , encode the password and then store the values in a database . Create a table named test with fields id,name,password where id is auto incremented.. */ if(isset($_post['submit'])) { $fname=$_POST['fname']; $pass=$_POST['password']; $encoded_pass=convert_uuencode($pass); $con=mysql_connect("your hostname","your username","your password"); //connecting to the database $db=mysql_select_db("your_database_name",$con); $sql="INSERT INTO test (id,name,age) VALUES('','$fname', '$encoded_pass' )"; $result=mysql_query($sql)or die("unable to insert"); } ?> </body> </html> ---- Server IP: 59.162.86.33 Probable Submitter: 122.166.40.225 ---- Manual Page -- http://www.php.net/manual/en/function.convert-uuencode.php Edit -- https://master.php.net/note/edit/83067 Del: integrated -- https://master.php.net/note/delete/83067/integrated Del: useless -- https://master.php.net/note/delete/83067/useless Del: bad code -- https://master.php.net/note/delete/83067/bad+code Del: spam -- https://master.php.net/note/delete/83067/spam Del: non-english -- https://master.php.net/note/delete/83067/non-english Del: in docs -- https://master.php.net/note/delete/83067/in+docs Del: other reasons-- https://master.php.net/note/delete/83067 Reject -- https://master.php.net/note/reject/83067 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139186) next »