Posted by Leszek on 12/29/05 03:23
Yes so maybe the problem is somewhere else...
here are my scripts
// zawiadomienie.php
<?php
$tresc1="
<b>Thanks you entered:<br />
{$_POST['$title']} {$_POST['$first_name']} {$_POST['$family_name']} <br />
{$_POST['$gender']} <br />
{$_POST['$address']} <br />
{$_POST['$pcode']} {$_POST['$city']} {$_POST['$country']} <br />
{$_POST['$phone']} <br />
{$_POST['$fax']}<br />
{$_POST['$email']}<br />
Names of accompanying porsons:</b><br />";
echo"<b><p>";
for ($i=1;$i<=5;$i++){
$osoba=$_POST["name"."$i"];
if (strlen($osoba)>0){
echo $osoba;
echo "<br>";
}
}
echo "</p></b>";
$tresc2="
<b>Nowy uczestnik konferencji zarejestrowal sie w bazie danych: </b><br
/><br />
Title: <b>{$_POST['$title']}</b> <br />
Family Name: <b>{$_POST['$family_name']}</b><br />
First Name: <b>{$_POST['$first_name']}</b><br />
Gender: <b>{$_POST['$gender']}</b><br />
Address: <b>{$_POST['$address']}</b> <br />
Postal Code: <b>{$_POST['$pcode']}</b><br />
City: <b>{$_POST['$city']}</b><br />
Country: <b>{$_POST['$country']}</b><br />
Phone: <b>{$_POST['$phone']}</b><br />
Fax: <b>{$_POST['$fax']}</b><br />
Email: <b>{$_POST['$email']}</b><br />
<br />
Accompanying persons are:<br />";
echo"<b>";
for ($i=1;$i<=5;$i++){
$osoba=$_POST["name"."$i"];
if (strlen($osoba)>0){
echo $osoba;
echo "<br>";
}
}
echo "</b>";
?>
// end of zawiadomienie.php
// wyslij_zaw.php
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use
SMTP
$mail->Host ="smtp.poczta.onet.pl"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username ="user"; // SMTP username
$mail->Password ="password"; // SMTP password
$mail->From ="leszekt80@poczta.onet.pl";
$mail->FromName ="{$_POST['$family_name']}";
$mail->AddAddress("leszekt80@poczta.onet.pl","EMBRYO");
#$mail->AddAddress("ellen@example.com"); // name is
optional
#$mail->AddReplyTo("info@example.com", "Information");
# $mail->WordWrap = 50; // set word wrap to
50 characters
# $mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
# $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to
HTML
$mail->Subject = "Registration";
$mail->Body = "$tresc2";
#$mail->AltBody = "This is the body in plain text for non-HTML mail
clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
// end of wyslij_zaw.php
// and the last one
//uzytkownik.php
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" />
</head>
<body>
<?php
// include('./zawiadomienia.php');
include('./wyslij_zaw.php')
?>
</body></html
// end of uzytkownik.php
it worked great until i added two "for" loops in "zawiadomienie.php"
and now user who sends data gets on the screen only variables from the both
"for" loops
and the one who recives is getting email with all the form variables without
the ones from the "for" loops
I have no idea why it doesn't work properly :((
Thanks for any ideas
Leszek
Navigation:
[Reply to this message]
|