Jump to content
MakeWebGames

RC Engine help: register.php


KaineBennett

Recommended Posts

Hey guys, On my game which is running the RC Engine, the home.php and register.php worked fine, havent touched it and it just says this to users whenever they try to sign up... It has only been open for 3 days and its only just doing the error.

this is the error:

There was an error with your email, Please try again.

»Okay

 

And I think it is coming from this bit:

   $message = "Hello ".$_POST['name'].",\n\n
               Your email address has been used for an account on Criminal-City.\n
               If this was not you please ignore this email.";
   if(!mail($_POST['email'], "Thank you for signing up to Criminal-City", $message, "From: [email protected]"))
   {
           echo "    There was an error with your email, Please try again.<br/>
                     »<a href='home.php";
           if($_GET['PID']) { echo '?PID=' . $_GET['PID']; } echo "'>Okay</a>";
   }
   else
   {
Link to comment
Share on other sites

  • I really hope you're sanitizing _POST's. As that would just throw your "There are no SQL vulnerabilities" claim straight out the water
  • Why are you hard-coding parameters; like the "From" field, and the "Subject" field?
  • Why are you mixing a lot of HTML with your model/back-end logic?
  • Why are you relying on mail()?
    • Putting it in an if() statement doesn't notify you if the e-mail gets delivered, if mail() returns TRUE
    • Why are you not either passing the e-mail to a 3rd party, or a library - SwiftMailer for example?

 

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.

Honestly, there are some questionable methods in the 10 lines you've posted, I can't wait to play and see the source of RC engine 2.0.

Further,

 

  • Make sure your subject fields complies with RFC-2047 standards.
  • Your mail body doesn't comply with the notes in the manual. "Each line should be separated with a CRLF (\r\n). Lines should not be larger than 70 characters."

 

But,

To answer your question;

Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

 

  • Ensure port 25 isn't blocked
  • Ensure your mail service is running
  • Look at the maillog, and see why it wasn't accepted for delivery
  • Have you configured your mail service?
Edited by sniko
Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...