PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
gavinbsocom
Forum Commoner
Posts: 71 Joined: Tue Sep 30, 2003 9:51 pm
Post
by gavinbsocom » Thu Nov 20, 2003 9:44 am
This is the second time im posting an email question an its the last. I wont to have multiple forms combined into one message so when someone clicks send it takes all the forms to my email.
Challenge.php
Code: Select all
<form method="post" action="mail.php">
TO : <input type="text" name="to" value="russian@bniclan.com">
SUBJECT : <input type="text" name="subject" value="">
Clan Name : <input type="text" name="msg1" value="">
Clan Tag : <input type="text" name="msg2" value="">
Leader Name : <input type="text" name="msg3" value="">
Time (eastern) : <input type="text" name="msg4" value="">
Server : <input type="text" name="msg5" value="">
Password : <input type="text" name="msg6" value="">
FROM : <input type="text" name="from" value="email@address">
<input type="submit" value="Send Email">
<input type="reset">
</form>
Mail.php
Code: Select all
<?php
$complete = "Email Sent !";
if($sent)
{
echo "$complete";
}
elseif($complete)
{
header('location:http://www.bniclan.com');
}
else
{
echo "Email Failed.";
}
?>
<html>
<body>
<?php
$to = $_POSTї"to"];
$subject = $_POSTї"subject"];
$message = $_POSTї"msg1" + "\n\r" + "msg2" + "\n\r" + "msg3" + "\n\r" + "msg4" + "\n\r" + "msg5"];
$from = $_POSTї"from"];
sent = mail($to, $subject, $message, $from);
?>
</body>
</html>
Understand what im trying to do? I'm tryign to have seperate forms that combine to the message and then is sent to my email. when the email is then opened then each form is on its own line.......Any Ideas?
Weirdan
Moderator
Posts: 5978 Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine
Post
by Weirdan » Thu Nov 20, 2003 9:48 am
use $message = $_POST["msg1"]."\n\r".$_POST["msg2"]."\n\r".$_POST["msg3"]."\n\r".$_POST["msg4"]."\n\r".$_POST["msg5"];
Nay
Forum Regular
Posts: 951 Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia
Post
by Nay » Wed Dec 03, 2003 9:50 am
How about:
Code: Select all
$message = <<< MESSAGE
{$_POST['msg1']}
{$_POST['msg2']}
{$_POST['msg3']}
{$_POST['msg4']}
{$_POST['msg5']}
MESSAGE;
or also:
Code: Select all
$message = $_POST['msg1'] . '\r\n' . $_POST['msg2'] . '\r\n' . $_POST['msg3'] . '\r\n' . $_POST['msg4'] . '\r\n' . $_POST['msg5'];
MESSAGE;
-Nay