--- In php-list@yahoogroups.com, James Keeline <[EMAIL PROTECTED]> wrote: > > --- On Wed, 9/17/08, David Halliday <[EMAIL PROTECTED]> wrote: > > > I am looking for a php function or script to encode a > > string and decode it (when required). Your help would be > > greatly appreciated. > > > > have thought of "md5" but the resulting string > > cant be decoded again! > > crc32 and sha1 functions are not good either. > > > > The function crypt () is also a One-way string encryption > > .. so that would not work as well. > > What I need it for is simply to encode (encrypt) a > > user's email - which now appears on the web page as is - > > and when someone clicks a link to contact that user, the > > script would decode it back to the proper email string. > > Hence the sender would not actually know the email address. > > > > There are ways to do it via mysql database but I thought if > > a I could do the crypting (and then decoding) via pure php > > script, it would ne less of a lod on the mysql db. > > Any suggestions would be greatly appreciated. It is a bit > > urgent. > > > > Best regards David > -------------------------- > You are probably looking for something like > > http://php.net/mcrypt_encrypt > http://php.net/mcrypt_decrypt > > James > -------------------------- You can simply use base64_encode() function to encode email and base64_decode() function to decrypt the email address.
best regards