monkeybidz Posted October 12, 2007 Share Posted October 12, 2007 This is the way o got this code: $pass=$_POST['pass']; $insert=mysql_query("insert into userlist values ('','$name','$email',AES_ENCRYPT('$pass','$mysecretkey'),now())"); In database password = password, it does not = pass Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/ Share on other sites More sharing options...
alexander007 Posted October 12, 2007 Share Posted October 12, 2007 INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....) Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/#findComment-367624 Share on other sites More sharing options...
monkeybidz Posted October 12, 2007 Author Share Posted October 12, 2007 Well, it inserts evreything else except the $pass Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/#findComment-367626 Share on other sites More sharing options...
adza Posted October 12, 2007 Share Posted October 12, 2007 why not trying to store your encrypted string in the $pass variable first.. that way you won't be trying to insert a function into a db table field... $pass = $_POST['pass']; $secure_pass = AES_ENCRYPT($pass, $mysecretkey); then insert $secure_pass into the table.... this is how i would try it, however i'm still rank n00b myself so, probably best taken with a grain of salt Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/#findComment-367661 Share on other sites More sharing options...
monkeybidz Posted October 13, 2007 Author Share Posted October 13, 2007 I will give it try. It makes sense. Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/#findComment-368268 Share on other sites More sharing options...
monkeybidz Posted October 13, 2007 Author Share Posted October 13, 2007 I get this error now: Fatal error: Call to undefined function: aes_encrypt() Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/#findComment-368328 Share on other sites More sharing options...
darkfreaks Posted October 13, 2007 Share Posted October 13, 2007 AES_ENCRYPT is not a PHP function rather a MYSQL function Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/#findComment-368339 Share on other sites More sharing options...
monkeybidz Posted October 13, 2007 Author Share Posted October 13, 2007 Ok, i got it to post all the fields now, but now i need to encrypt the password and be able to decrypt. What i am posting here will only insert the secret key+password+secret key again, but is it safe? $password=$mysecretkey.$_POST['pass'].$mysecretkey; $insert=mysql_query("INSERT INTO `userlist` (id, name, email, password, startdate)VALUES('','$name','$email','$password',now())"); Link to comment https://forums.phpfreaks.com/topic/72887-mysql-insert-problem/#findComment-368399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.