PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I one-way encrypt a string in PHP?


This one is easy in PHP using the crypt function.

<?php

$mydata 
'mypassword';

$code crypt($mydata);

?>


Remember that this is a one way function, so if you use this when storing user password information, for instance, you will not be able to send them a password reminder but rather will need to identify them based on some other info (e.g. username and email combo) and then let them reset a password.



Comment on this Question and Answer >>>

ASK A QUESTION

More strings PHP Questions

How do I find the last occurrence of a character in a string?

How do I display newline characters on a webpage?

How do I make the contents of a string lower case?

How do you hash the password in this php script: define(sb db user name, admin store); define(sb db password, mypassword);

How do I make sure a string is a certain length?



Custom Search