Link to home
Start Free TrialLog in
Avatar of Wanda Marston
Wanda MarstonFlag for Canada

asked on

Creatin a temporary random password in a PHP document

Forgot Password page

I am attempting to code a page were a user can go to create a temporary password which will be sent to their email address.

I have included some code at which point I receive the following error. - password_hash() expects at least 2 parameters, 1 given

	

// Create a new, random password:
		
$p = substr(md5(uniqid(rand(), true)), 3, 15);
		
$ph = password_hash($p);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Beverley Portlock
Beverley Portlock
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wanda Marston

ASKER

It worked. Thank you.

Can I ask why "PASSWORD DEFAULT" makes a difference?
There are different methods for generating the password. It wants you to indicate which method you want to use. The others are listed in the link I gave in the answer