Jump to content

Question About Functions.


BrettHartel

Recommended Posts

Thank you for taking the time to help me :)

 

I am curious about this function when $salt is created. Will it use the $POST['eMail'] or does it use $eMail?

 

eMail = "[email protected]";
$_POST['eMail'] = "[email protected]";
$salt = generateSalt($_POST['eMail']);
function generateSalt($eMail) {
$salt = '$2a$13$';
$salt = $salt . md5(strtolower($eMail));
return $salt;
}

 

How could I make it so that any information I request is used in the function?

 

For example:

 

$salt1 = generateSalt($_POST['eMail']);
$salt2 = generateSalt($_POST['Username']);
$salt3 = generateSalt($_POST['FirstName']);
$salt4 = generateSalt($_POST['LastName']);

 

This is just an example I created to ape for future functions.

 

Sincerely,

 

Brett Hartel

Link to comment
https://forums.phpfreaks.com/topic/272120-question-about-functions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.