I am creating my login page and when I loaded it up I seemed to get this error saying:
Fatal error: Cannot redeclare email() (previously declared in /home/a4625512/public_html/core/functions/general.php:2) in /home/a4625512/public_html/core/functions/general.php on line 4
My host is 000WebHost so I don't know if it has something to do with them, and I have searched online everywhere for it.
general.php code:
function email($to, $subject, $body) {
mail($to, $subject, $body, 'From: hello@points4u.com');
}
Login Code:
include 'core/init.php';
if(empty($_POST) === false){
$username = $_POST['username'];
$password = $_POST['password'];
if(empty($username) === true || empty($password) === true){
$errors[] = 'You need to enter a username and password.';
}else if(user_exists($username) === false){
$errors[] = 'We cant find that username. Have you registered?';
}else if(user_active($username) === false){
$errors[] = 'You have not activated your account!';
}else{
$login = login($username, $password);
if($login === false){
$errors[] = 'That username/password is incorrect.';
}else{
$_SESSION['user_id'] = $login;
header('location: index.php');
exit();
}
}
print_r($errors);
}