php - Why does this only work once? -
i'm trying put simple feedback form uses php email results us. script works once, email intended.. every time afterwards, there's no email , no error. have idea why?
<?php $email_to = "admin@urbansushi.com"; $name = $_post['name']; // required $email = $_post['email']; // required $date = $_post['date']; // required $email_subject = "new feedback customer"; $email_message .= "name: ".clean_string($name)."\n"; $email_message .= "date of visit: ".clean_string($date)."\n"; $email_message .= "email: ".clean_string($email)."\n"; // create email headers $headers = 'from: '.$email."\r\n". 'reply-to: '.$email."\r\n" . 'x-mailer: php/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?>
you concatenating $email_message not declaring initially:
$email_message .= "name: ".clean_string($name)."\n";
try adding this
$email_message = ""; $email_message .= "name: ".clean_string($name)."\n";
also have whitespace before php declaration - try removing php declaration @ start of file
<?php
Comments
Post a Comment