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 length of a string in PHP?

How can I remove spaces from around a string value?

I retrieve data from a Mysql database and insert it into a textfield form. The data that I retrieve have a / at the end of the string. The data in the database does not have this / in the data. How do I remove this /?

How do I display newline characters on a webpage?

How do I convert newlines to HTML line break tags?



Custom Search