Internet Computer Mobile Games

Need Help With Preventing Email Injection

Hi, I really don't know much about php code and need help. Could you tell me what I need to add to this email form php code to stop spammers from email header injection? My hosting account recently was sending spam emails that I did not send and I thought this might be the problem. Thanks.

 

Here is what I have now:

 

 

<?php

$to = "[email protected]";
$subject = "Pottery Question";
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$questions = $_REQUEST['questions'] ;
$spam = $_REQUEST['spamcheck'] ;

{
if ($spam == 4){

$message .= "Name: \n";
$message .= $name;
$message .= "\n";
$message .= "\n";
$message .= "Email: \n";
$message .= $email;
$message .= "\n";
$message .= "\n";
$message .= "Questions: \n";
$message .= $questions;  

$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your message was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
}

else {header( "Location: http://www.go.away" ); die();}
}

?>

Top similar posts to Need Help With Preventing Email Injection

Email suddenly stops collecting messages

I think I've identified an email bug. Essentially, email stops being collected when Android Email (MailService) is presented with a message that has been identified by the mail server as either unavailable, missing or had been recalled by the sender. My desktop Outlook application also sees the same messages and gives an error code (0x800CCC90 -ERR unable to open that message). The difference between Outlook and Android is that Android just stops collecting any more messages (new or ...

since software upgrade email on opening is blank

The email that comes with the galaxy tablet 2(10.1) is blank when accessing email since software upgrade to Android 4.2.2, any ideas on how i re-install? The app does not appear in samsung store and must be part of the operating system.any ideas would be most welcome ...

Phone is trying to launch email app for phone calls

When trying to make/answer a call I keep getting a 'complete action using' prompt for an email application. It makes no difference whether I opt for 'Always' or 'Just once' as the prompt wont go away. Reading other threads it would seem uninstalling apps is an answer. But surely I can't uninstall the 'phone' app? ...

Email help or Galaxy S5

How do I add an email account to the S5 that I only want to send from or reply to received emails that is different from my main email account? This......

Samsung tab 2 won't open email

When pushing the email app all it does is give me a white screen even tho it says on the widget that I have new emails?!? How can I fix this... Need my emails URGENTLY! Thank you ...

Samsung tab 2 won't open email

When pushing the email app all it does is give me a white screen even tho it says on the widget that I have new emails?!? How can I fix this... Need my emails URGENTLY! Thank you ...

Default Email client fails

The recent Tab 2 (Oct 2014) update appears to have screwed my default Email but all other apps appear to work. The emails are delivered to my Android device. The first line of incoming message is visible and it can change to 2 or 3 lines. Also msgs can be delete from the Tablet. Try opening any of the emails; the email app closes almost immediately. Trying to write an email from the app All that appears is a completely blank white screen which enventually closes. Tried deleting the email ...

after the latest software update for my tab2 10.1 I have no email and cannot add an email account

My email page is just a white screen ive tried adding an email account in settings but the button will not go green to allow this ...

Is it possible to copy text from an email to paste into a 'quick memo'?

I keep various records on my phone... Now I've upgraded to the LG G3 (D855) I want to copy over some info from my old phone (BlackBerry 9700), but when I've emailed the info to myself, I can't find a way to copy the text in the email to paste into a memo. Any suggestions please? ...

Default Email client fails

The recent Tab 2 (Oct 2014) update appears to have screwed my default Email but all other apps appear to work. The emails are delivered to my Android device. The first line of incoming message is visible and it can change to 2 or 3 lines. Also msgs can be delete from the Tablet. Try opening any of the emails; the email app closes almost immediately. Trying to write an email from the app All that appears is a completely blank white screen which enventually closes. Tried deleting the email ...

how to delete an email account on samsung galaxy s3

Cannot find the option to delete email account on. I want to create new email account ...

Not receiving email notifications

Droid DNA - not getting email notifications even though the box is checked to receive them. Any ideas what to do? Thanks. Posted via Android Central App ...

F.S. - MPower or MTechnic ornament for Injection tube for M50/M52 S50/S52

F.S. - MPower or MTechnic ornament for Injection tube for M50/M52 S50/S52 Want you a new look for your engine ? For sale MPower or MTechnic ornament for Injection tube . ( or cusom +20 USD ). You must paste with black silicone for gaskets engine. Available for M50/M52 S50/S52 . Material plastic/chrome engraved like OEM cover. List Date: 10/5/2014 For more info, click here to view the original listing: F.S. - MPower or MTechnic ornament for Injection tube for M50/M52 S50/S52 ---------------...

Email send & receive problems

I have 2 email accounts on this tablet. I have no problem with the gmail account but my verizon account won't send or receive. Help please. This has been happening for about a week. ...

Design Apple Development Security Automobile Network Photography Health Money Travel Shopping Issues Operating systems Drivers Software Programming Tech Home Science Sport Solution