JeanieTallis Posted March 30, 2009 Share Posted March 30, 2009 I recieve this error when trying to register an account. Fatal error: Call to undefined function valid_email() in /home/myveeco/public_html/register.php on line 7 this is the selection of code with errors. <?php session_start(); require_once('settings.php'); if ( array_key_exists ( '_submit_check', $_POST ) ) { if ( $_POST['full_name'] != '' && $_POST['email'] != '' && $_POST['username'] != '' && $_POST['password'] != '' && $_POST['password'] == $_POST['password_confirmed'] && $_POST['country'] != '' && $_POST['user_code'] != '' && valid_email ( $_POST['email'] ) == TRUE ) { if ( ! checkUnique ( 'Username', $_POST['username'] ) ) { $error = 'Username already taken. Please try again!'; } elseif ( ! checkUnique ( 'Email', $_POST['email'] ) ) { $error = 'The email you used is associated with another user. Please try again or use the "forgot password" feature!'; } elseif ( ! checkUnique (md5($_POST['user_code'] ),$_SESSION['ckey'] ) ) { die("Invalid code entered. Please enter the correct code as shown in the Image"); } else { $query = $db->query ( "INSERT INTO " . DBPREFIX . "users (`full_name` , `Email` , `Username` , `Password` , `Country` , `date_registered` , `Random_key`) VALUES (" . $db->qstr ( $_POST['username'] ) . ", " . $db->qstr ( md5 ( $_POST['password'] ) ).", '" . time () . "', " . $db->qstr ( $_POST['email'] ) . ", '" . random_string ( 'alnum', 32 ) . "')" ); This is line 7 which causes the error if ( $_POST['full_name'] != '' && $_POST['email'] != '' && $_POST['username'] != '' && $_POST['password'] != '' && $_POST['password'] == $_POST['password_confirmed'] && $_POST['country'] != '' && $_POST['user_code'] != '' && valid_email ( $_POST['email'] ) == TRUE ) Any help? thanks Quote Link to comment https://forums.phpfreaks.com/topic/151735-valid-email-error/ Share on other sites More sharing options...
Ayon Posted March 30, 2009 Share Posted March 30, 2009 the error message is just telling you that the function valid_email() doesn't exist Quote Link to comment https://forums.phpfreaks.com/topic/151735-valid-email-error/#findComment-796776 Share on other sites More sharing options...
JeanieTallis Posted March 30, 2009 Author Share Posted March 30, 2009 How do I make it so it does exist though Quote Link to comment https://forums.phpfreaks.com/topic/151735-valid-email-error/#findComment-796777 Share on other sites More sharing options...
JonnoTheDev Posted March 30, 2009 Share Posted March 30, 2009 Make sure that the script has the file included where this function resides. include('path/to/function/file.php'); // rest of script Quote Link to comment https://forums.phpfreaks.com/topic/151735-valid-email-error/#findComment-796778 Share on other sites More sharing options...
JeanieTallis Posted March 30, 2009 Author Share Posted March 30, 2009 I sorted it. thanks. i changed the code so that its all involved in. more errors occur, got new thread Quote Link to comment https://forums.phpfreaks.com/topic/151735-valid-email-error/#findComment-796823 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.