![]() |
Decode mysql with php
i can encode this into a blob on my table
but how the fuck do i decode it? $string = "insert into user (username, passwd, email, verify,prefs)values ('$username', ENCODE('$password', 'ba'), '$email','$code','$prefs')"; $result = mysql_query($string); |
why would you put that into a blob?
|
the MySQL encode() function returns a binary string, which needs to be stored in a BLOB column type
|
why use encode()? why not md5() or mcrypt()?
anyways, you have to use the decode() function, but it needs the result of encode() DECODE (encrypted_password, pass_string) |
because i wanted to echo their current password and give them the option to change it, but i guess i will just give them the option to change it without displaying their current password
|
Use md5 :)
Cheers, Matt |
Quote:
just like the password() function goes in but cant come out |
I don't see why you'd show them their password and then offer to change it, unless the password is randomly generated?
|
well here is the deal
im writing the script so when they signup they choose their own password, but if they lose their password it generates one randomly. So Then I wanted to Display the generated password and let them change it to something else .. but i will just let them change it , by typing in a new password , then updating the table .. just like it did when they signed up |
Yeah md5 is one-way encoding...why not use crypt() ?
|
why use encoding if its gonna be decodable? it doesnt really provide security then.
|
Quote:
thats the common way of doing it ...or during the reset process, you can have them choose what pass to reset it to.. |
Quote:
|
All times are GMT -7. The time now is 01:49 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123