Im Jake Posted February 15, 2009 Share Posted February 15, 2009 Fatal error: Cannot redeclare class Mailer in /home/imjake/public_html/includes/mailer.php on line 3 <? class Mailer { /** * sendWelcome - Sends a welcome message to the newly * registered user, also supplying the username and * password. */ function sendWelcome($user, $email, $pass){ global $settings,$HTTP_SERVER_VARS; $from = "From: ".$HTTP_SERVER_VARS['SERVER_ADMIN']." <".$HTTP_SERVER_VARS['SERVER_ADMIN'].">"; $subject = $settings['site_title']." - Welcome!"; $body = $user.",\n\n" ."Welcome! You've just registered at ".$settings['site_title'] ." with the following information:\n\n" ."Username: ".$user."\n" ."Password: ".$pass."\n\n" ."If you ever lose or forget your password, a new " ."password will be generated for you and sent to this " ."email address, if you would like to change your " ."email address you can do so by going to the " ."My Account page after signing in.\n\n" ."- ".$settings['site_title']."\n".$settings['urlname']; return mail($email,$subject,$body,$from); } Link to comment https://forums.phpfreaks.com/topic/145258-fixing-a-error/ Share on other sites More sharing options...
genericnumber1 Posted February 15, 2009 Share Posted February 15, 2009 You probably included that file twice by accident. Change all include()s to include_once()s and the same for require()s and see if that fixes your problem. If it doesn't, try to find out why you have two classes named Mailer. Link to comment https://forums.phpfreaks.com/topic/145258-fixing-a-error/#findComment-762531 Share on other sites More sharing options...
Cory94bailly Posted February 15, 2009 Share Posted February 15, 2009 You probably included that file twice by accident. Change all include()s to include_once()s and the same for require()s and see if that fixes your problem. If it doesn't, try to find out why you have two classes named Mailer. "require_once()" Is recommended Hey jake. Link to comment https://forums.phpfreaks.com/topic/145258-fixing-a-error/#findComment-762583 Share on other sites More sharing options...
genericnumber1 Posted February 15, 2009 Share Posted February 15, 2009 Well I said "the same for require()s"! But yes, you're right, I should have been clearer, thanks for the addition. Link to comment https://forums.phpfreaks.com/topic/145258-fixing-a-error/#findComment-762585 Share on other sites More sharing options...
Cory94bailly Posted February 15, 2009 Share Posted February 15, 2009 Well I said "the same for require()s"! But yes, you're right, I should have been clearer, thanks for the addition. No sorry, I read it wrong and re-edited. Link to comment https://forums.phpfreaks.com/topic/145258-fixing-a-error/#findComment-762588 Share on other sites More sharing options...
genericnumber1 Posted February 15, 2009 Share Posted February 15, 2009 Yeah, I agree, require is much better than include, nothing like a script catastrophically failing because a file was accidentally moved or deleted. Link to comment https://forums.phpfreaks.com/topic/145258-fixing-a-error/#findComment-762594 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.