Mervli Türkmen Mervli Türkmen - 29 days ago 17
PHP Question

Encrypting and decrypting passwords with php

I want store passwords encrypted in database. For this purpose I use

md5 ();
or
sha1 ();
functions. But if my users send a password reset request I want to send them their password instead of reset link. But problem is, with both of these functions I can't decrypt passwords. Is there any function that both can encrypt and decrypt strings?

Answer

If you want some sort of notification to appear without the page reloading, you need to use AJAX.

I think the best way to do what your asking is make a database and set a column that gives an id of 0 or 1. If the user clicks it then it sets that id=1. You can then check whether id = 1, and display an message using AJAX.

Look here for more info http://api.jquery.com/jquery.ajax/