johnnyboy16 Posted March 10, 2010 Share Posted March 10, 2010 Hey guys. Jusy starting to learn how to program. I have a comments thread on my website. I'm trying to write a basic script that will allow users to 'report comments for moderation' Everything seems to be working except that when i send a report the emails that i receive don't include the subject or comment of the form. Also, I receive the email multiple times. Any help would be greatly appreciated. Here's my script so far... <?php if(empty($errors)){ $subject = "Comment Report"; $headers = "From: support@".EMAIL_DOMAIN." <support@".EMAIL_DOMAIN.">\\r\\n"; $headers .= "Reply-To: support@".EMALI_DOMAIN."\\r\\n"; $headers .= "Return-Path: support@".EMAIL_DOMAIN."\\r\\n"; $headers .= "X-Mailer: PHP/".phpversion()."\\r\\n"; $message = "Subject: ".$inputs['subject']." Comments: ".$inputs['comment']; mail("[email protected]",$subject,$message,$headers); $sent = 1; } $subjects = array("Comment posted on wrong profile.","Inappropriate or offensive language.","Violation of Terms of Service."); ?> <div class="bg_wide"> <p style='font-size: 17px; font-weight: bold; color: #B2FF24; text-align: left; padding-left: 15px; padding-top: 15px;'> Report a comment </p> <p style='font-size: 13px; font-weight: normal; color: #fff; text-align: left; line-height: 14pt; padding-top: 10px; padding-left: 16px; width: 94%;'> In order to report this comment to our attention please select a reason below. If necessary, feel free to include more details in the text field. Thank you for keeping a lookout! </p> <br /> <form action="report.php" method="post"> <table class="f_input"> <tr> <td> <?php echo "<select name='subject' style='width: 235px; margin-bottom: 5px; padding: 2px; margin-left: 13px;'>"; foreach($subjects as $v){ echo "<option value='".$v."' "; if($_POST['subject'] == $v){ echo "selected='selected'"; } echo ">".$v."</option>"; } echo "</select>"; ?> </td> </tr> <tr> <td> <textarea name='comment' rows='10' cols='20' style='width: 385px; height: 65px; font-size: 14px; padding-left: 2px; margin-left: 13px;>'><?php echo $inputs['comment'];?></textarea> </td> </tr> </table> <table> <tr style='height: 33px;'> <td style="width: 150px;"></td> <td style='padding-left: 112px; padding-top: 10px;'> <input type="submit" class="send_button" value="" /> </td> </tr> </table> </div> </form> Thank you for the help! Link to comment https://forums.phpfreaks.com/topic/194731-issues-with-user-feedback-script/ Share on other sites More sharing options...
teamatomic Posted March 10, 2010 Share Posted March 10, 2010 Probably because you hard code the subject in and it really does not matter because you dont convert any of the posted data from the form. and its $_POST['xxxx'] where does the $inputs['xxx'] come from?? As for the multiple mails. how many times do you click the submit button?? HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/194731-issues-with-user-feedback-script/#findComment-1024069 Share on other sites More sharing options...
johnnyboy16 Posted March 10, 2010 Author Share Posted March 10, 2010 got it! thanks Link to comment https://forums.phpfreaks.com/topic/194731-issues-with-user-feedback-script/#findComment-1024078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.