html - Cannot get email from this php form -


I am creating an email form on my website. For some reason, I can not get an email from this form.

html

  & lt; Form method = "POST" action = "processor.php" id = "contactform" onsubmit = "return (validateForm ());" & Gt; & Lt; Div & gt; & Lt; Label = "fname" & gt; First name: & lt; Br> & Lt; / Label & gt; & Lt; Input type = "text" name = "fname" id = "fname" value = "" class = "required" /> & Lt; / Div & gt; & Lt; Div & gt; & Lt; Label = "lname" & gt; Last name: & lt; Br> & Lt; / Label & gt; & Lt; Input type = "text" name = "lname" id = "lname" value = "" class = "required" /> & Lt; / Div & gt; & Lt; Div & gt; & Lt; Label = "organization" & gt; Organization: & lt; Br> & Lt; / Label & gt; & Lt; Input type = "text" name = "organization" id = "organization" value = "" class = "required" /> & Lt; / Div & gt; & Lt; Div & gt; & Lt; Label = "email" & gt; Email: & lt; Br> & Lt; / Label & gt; & Lt; Input type = "text" name = "email" id = "email" value = "" class = "expected email" /> & Lt; / Div & gt; & Lt; Div & gt; & Lt; Label = "phone" & gt; Phone: & lt; Br> & Lt; / Label & gt; & Lt; Input type = "text" name = "phone" id = "phone" value = "" class = "required" /> & Lt; / Div & gt; & Lt; Div & gt; & Lt; Label = "message" style = "row-height: 2;" & Gt; Message: & lt; Br> & Lt; / Label & gt; & Lt; Textarea rows = "20" cols = "20" name = "message" id = "message" & gt; & Lt; / Textarea & gt; & Lt; / Div & gt; & Lt; Input id = "submit" name = "submit" type = "submit" class = "submit-button myButton" value = "send" /> & Lt; Div class = "clearfix" & gt; & Lt; / Div & gt; & Lt; / Form & gt;  

PHP

  & lt ;? Php if ($ _SERVER ['REQUEST_METHOD'] == "POST") {If (struts ($ _ server) HTTP_REFERER '], $ _SERVER [' HTTP_HOST ']) & gt; 7 || Stroops ($ _ server ['HTTP_REFERER'], $ _SERVER ['HTTP_HOST'])) ("Bad Referrer"); $ Msg = "Website Message: \ n \ n \ n"; Forex currency ($ key = $ {$ val} as $ _POST) {if_array ($ val)) {$ msg} "item: $ key \ n \ n"; Foreign Currency ($ VL $ V) {$ v = StripSearch ($ V); $ Msg = "$ V \ n \ n"; }} And {$ val = straps ($ val); $ Msg = "$ Key: $ well \ n \ n"; }} $ Recipient = "test@example.com"; $ Theme = "website contact form filled"; (0) error_reporting; If (mail ($ recipient, $ subject, $ msg)) {header ("location: http://www.example.com/thankyou.html"); } And echo "An error occurred and the message could not be sent."; } And "bad request method" echo; ? & Gt;  

It is a matter of fact that PHP code works because it works with other HTML forms. I am thinking that HTML is the reason of the method of coding or if anyone knows the PHP and well, please help me please thank you!

Try it out:

  print_r ($ _ POST); Go out;  

Before your code

  // here if ($ _SERVER ['REQUEST_METHOD'] == "POST") {If (SRPO ($ _SERVER ['HTTP_REFERER'], $ _SERVER ['HTTP_HOST']) & gt; 7 ||! Strokes ($ _ server ['HTTP_REFERER'], $ _SERVER ['HTTP_HOST'])) ("Bad Referrer"); If you will see the email contained in the variable - then some errors in your PHP script and even more - enable display of errors (i.e. error reporting) 

I saw you said that it is completely different Works. Can I see the code of this form, please?


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -