After getting a lot searching and negative marks..i did solved my qus..
just edit the mypdf.php
mypdf.php
<?php
include('pdf.php');
if(isset($_POST['submit']) && $_POST['submit']!='' && $_POST['fname']!='')
{
//for mail(i din use it as m wrking offline but hope it will work
/*$to = "xyz@gmail.com"; // this is your Email address
$from = $_POST['email']; // this is the sender's Email address
$first_name = $_POST['fname'];
$last_name = $_POST['surname'];
$mbile = $_POST['mobile_no'];
$email = $_POST['email'];
$subject = "Form submission";
//$subject2 = "Copy of your form submission";
$message = $first_name . " " . $last_name . " " . $mbile . " " . $email . "\n\n" . $_POST['message'];
//$message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
//mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
// You can also use header('Location: thank_you.php'); to redirect to another page.
// You cannot use header and echo together. It's one or the other.
*/
$msg = "title: " .$_POST['title'] . "\n"
."fname: " .$_POST['fname'] . "\n"
."middle: " .$_POST['mail_add'] . "\n"
."surname: " .$_POST['mobile_no'] . "\n"
."email: " .$_POST['email'] . "\n"
."mail_add: " .$_POST['education'];
$staffEmail = "staffemail";
// get your $N value for hear
$h1_heading = "User Detail";
$pdf_filename = tempnam(sys_get_temp_dir(), "pdf");
$pname = explode("\\", $pdf_filename);
$a=$pname[3];
$pname1 = explode(".", $a);
$cname=$pname1[0];//final name for file
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial", "B", 16);
$pdf->Cell(40, 10, "User Detail");
$pdf->Ln();
$pdf->SetFont("Arial", "", 12);
$pdf->Cell(40, 10, "First Name:");
$pdf->SetFont("Arial", "B", 12);
$pdf->Cell(40, 10, $_POST['fname']);
$pdf->Ln();
$pdf->SetFont("Arial", "", 12);
$pdf->Cell(40, 10, "Address:");
$pdf->SetFont("Arial", "B", 12);
$pdf->Cell(40, 10, $_POST['mail_add']);
$pdf->Ln();
$pdf->SetFont("Arial", "", 12);
$pdf->Cell(40, 10, "Mobile No:");
$pdf->SetFont("Arial", "B", 12);
$pdf->Cell(40, 10, $_POST['mobile_no']);
$pdf->Ln();
$pdf->SetFont("Arial", "", 12);
$pdf->Cell(40, 10, "E-mail:");
$pdf->SetFont("Arial", "B", 12);
$pdf->Cell(40, 10, $_POST['email']);
$pdf->Ln();
$pdf->SetFont("Arial", "", 12);
$pdf->Cell(40, 10, "Education:");
$pdf->SetFont("Arial", "B", 12);
$pdf->Cell(40, 10, $_POST['education']);
$a=$_POST['mobile_no'];
$pdf->output("pdf/". "$a" .$cname.".pdf" , 'f');
$pdf->Ln(45);
header("Location:index.php");
}
else
{
header("Location:membership-form.php");
}
?>