Here's a snippet of my code:
<?
include("include/session.php");
//include("forum/global.php");
$con = mysql_connect($dbhost,$dbuser,$dbpass);
$time = time();
$date = date("Y-n-j H:i:s");
$ip = $_SERVER['REMOTE_ADDR'];
$email = $_POST['email'];
$lastname = ucwords($_POST['lastname']);
$firstname = ucwords($_POST['firstname']);
$firstinitial = $firstname[0];
$username = $firstinitial."_".$lastname;
$pass = $_POST['password'];
// MYBB
function generate_salt()
{
return random_str(8);
}
function salt_password($password, $salt)
{
return md5(md5($salt).$password);
}
$md5pass = md5($pass);
$salt = generate_salt();
$salted_pass = salt_password($md5pass, $salt);
$loginkey = random_str(50);
I get this error:
Fatal error: Call to undefined function random_str() in /home/myusername/public_html/thefile.php on line 20
Line 20 is the return random_str() line.
Can someone help me solve my problem please?