Hi,
while i'm executing my php code i'm getting error as undefined variable.Pls do notify the mistakes i've made.Herewith i'm attaching my codings.its urgent.......
Thanks in advance.
mail.php
<?php
$toaddress = 'myaddress@website.com' . ', ';
$toaddress .= 'myaddress2@website.com';
mail_attachment("$toaddress", "$first_name", "$last_name", "$username", "$email", "$telephone","$address");
function mail_attachment ($from , $to, $subject, $first_name, $last_name, $username, $email, $telephone,$address)
{
$email_from = $from;
$email_subject = $subject;
$email_username =$username;
$email_telephone=$telephone;
$email_address=$address;
$email_to = $to;
$headers = "From: ".$email_from;
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$email_username.= $msg_txt ;
$email_message .= " \n\n".
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
"Username :" . $email_username . "\n\n";
$email_telephone .= $msg_txt;
$email_message .= ".\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
"Telephone :" . $email_telephone . "\n\n";
$email_address .= $msg_txt;
$email_message .= ".\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
"Address :" . $email_address . "\n\n";
$data = chunk_split(base64_encode($data));
$email_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
$ok = @mail($email_to,$email_subject, $email_message, $headers );
if($ok) {
echo "<font face=verdana size=2>The file was successfully sent!</font>";
} else {
die("Sorry but the email could not be sent. Please go back and try again!");
}
}
?>
sendmail.php
<?php
$firstname = $_REQUEST['firstname'] ;
$lastname = $_REQUEST['lastname'] ;
$username=$_REQUEST['username'] ;
$password=$_REQUEST['password'];
$confirm_password=$_REQUEST['confirm_password'];
$email = $_REQUEST['email'] ;
$telephone = $_REQUEST['telephone'] ;
$address=$_REQUEST['address'];
if (isset($_REQUEST['submit']))
{
if (!$_REQUEST['firstname']
| !$_REQUEST['lastname']
| !$_REQUEST['username']
| !$_REQUEST['password']
| !$_REQUEST['confirm_password']
| !$_REQUEST['email']
| !$_REQUEST['telephone']
| !$_REQUEST['address'] )
{
die('You did not complete all of the required fields');
}
if ($_REQUEST['password'] != $_REQUEST['confirm_password'])
{
die('Your passwords did not match. ');
}
}
?>
<?php include("mail.php");?>



