raydona Posted August 27, 2014 Share Posted August 27, 2014 Hi,The array shown below is causing problems. I know this for sure because when I comment the array out the script runs. Is it: 'pswrd1'=>SHA1('$_POST['pswrd1']') inside the array causing the script not to run?? All help will be greatly appreciated.$register_data =array('username'=>$_POST['username'], 'first_name'=>$_POST['first_name'], 'last_name'=>$_POST['last_name'], 'address'=>$_POST['address'], 'postcode'=>$_POST['postcode'], 'country'=>$_POST['country'], 'e_mail'=>$_POST['e_mail'], 'pswrd1'=>SHA1('$_POST['pswrd1']'), 'phone_no'=>$_POST['phone_no']); Link to comment https://forums.phpfreaks.com/topic/290670-how-to-place-encrypted-variable-inside-array/ Share on other sites More sharing options...
cpd Posted August 27, 2014 Share Posted August 27, 2014 If you're keeping the mapping you can just do $data = $_POST; $data['pswrd1'] = sha1($_POST['pswrd1']); The error is due to wrapping the password variable in your sha1 call with apostrophes. You don't need to as shown above. Link to comment https://forums.phpfreaks.com/topic/290670-how-to-place-encrypted-variable-inside-array/#findComment-1489030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.