Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6987775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:58:58+00:00 2026-05-27T18:58:58+00:00

A client recently got a spam warning from their host. I think I have

  • 0

A client recently got a spam warning from their host.

I think I have pin pointed the issue to an old contact us form. Simple html on the front end and a simple PHP script on the back end.

    if ($_POST['submit'] == "Send"){

    //START SEND MAIL SCRIPT 
    $mail = $_POST['email'];
    $to = "me@gmail.com";
    $subject = "Message from Website Contact Us Form";
    $headers = "From: Contact us Form <webmaster@website.co.uk>";
    $message = "Message from Contact Us Form\n\n";
    $message .= "\nName: " . $_POST['contactname'];
    $message .= "\nEmail: " . $_POST['contactemail'];
    $message .= "\nTelephone: " . $_POST['contactphone'];
    $message .= "\n\n\nMessage:\n" . $_POST['contactmessage'];


        if(mail($to,$subject,$message,$headers)) {

                header('Location: http://www.website.co.uk/contact-us/?action=success');

        }else{

                header('Location: http://www.webisite.co.uk/contact-us/?action=fail');                          

        }//END IF MAIL

}//END SCRIPT

I know the remedies to fix it such as sanitizing post vars properly, using captchas, using a hidden ‘honeypot’ blank field, js tricks etc etc (I also like the look of this script too http://www.alt-php-faq.com/local/115/)

But to help me understand what was going on I want to know how this script is being manipulated. A foreign script posting vars to it but how do they send email to anyone apart from
‘me@gmail.com’ or if they are forcing cc / bcc fields somehow why do I not get all spam as well??

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:58:59+00:00Added an answer on May 27, 2026 at 6:58 pm

    Line like this $message .= "\nName: " . $_POST['contactname']; can be dangerous.
    If $_POST['contactname']='MegaSteve4 \r\nCc: email1@mail.com, email2@mail.com'; are set, 2 uses will get spam mail.

    See carefully. Its appending more headers. In this case Cc. I am not sure if Cc is a raw email header. But I hope you get the idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have recently got a client that have the ability to send files (text
Recently I got a client that wanted to have new features and a different
We recently were given a client requirement to encrypt all their data while at
I recently had a client contact me asking for an update to his project
I have been technically testing a WCF service recently and have got to the
I recently had this issue with a client. The code read: ini_set( sendmail_from, noreply@<current-domain>.com
I have worked on several distributed client/server projects recently, and one pain point that
I recently got a new machine at work, and moved from XP 32 Bits
I've recently began on working on my first CORBA project. I think I got
I have VS2010 Professional installed A client has recently asked me to add a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.