Gatsu Posted October 28, 2007 Share Posted October 28, 2007 Hi, I have a website that will send mail with these codes:Form: <?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email { //send email $email = $_REQUEST['email']; $subject = $_REQUEST['subject']; $message = $_REQUEST['message']; mail( "info@planet-zix.se", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; }else//if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> MSN: <input name='msn' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> Test: </textarea><br /> <input type='submit' /> </form>"; }?> and...mailform.php <?php$to = "info@planet-zix.se";$subject = $_POST["subject"];$msn = $_POST["msn"];$message = $_POST["message"];$from = "Leveling Order";$headers = "From: $from";mail($to,$subject,$message,$headers);echo "Thank you for using my mail form //Gatsu";?> Now how do I manage to get the MSN field in the mail?I have no idea how to do this so the $msn I added in mailform.php are probably totally wrong ^^I want the msn field to show in the message.Anybody know how to fix this or atleast show me what tutorial to read? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 29, 2007 Share Posted October 29, 2007 You can build the message to have whatever you want in it.$message = "MSN: {$_POST['msn']}\n\nMessage:\n{$_POST['message']}"; Link to comment Share on other sites More sharing options...
Gatsu Posted October 29, 2007 Author Share Posted October 29, 2007 You can build the message to have whatever you want in it.$message = "MSN: {$_POST['msn']}\n\nMessage:\n{$_POST['message']}";thank you very much, this will help me alot in the future =) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.