Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Thanked 0 Times in 0 Posts

    php script redirect while sending pdf as attachement

    I am new in php programming and I have develop php script using TCPDF libary that takes data from pdf form fields and create flatten copy of that PDF using TCPDF , after that I use "AttachMailer.php" to send copies of PDF to client and customer, when user fill pdf form and click submit button flatten copy of that pdf is created in wp-content/uploads/pdf folder , and email code gets same copy fro wp-content/uploads/pdf folder and copy is forwarded to client and customer once copies are forwarded, it should show message "email has been sent.....email-address".

    // =============Email Form===============================
    $mailer = new AttachMailer($Email, $Email, "Submitted Form Copy", "hello <b>Please Find the Attached Copy of form sumitted</b>");


    $mailer1 = new AttachMailer($Email,$CEmail, "CC for client Submitted Form ", "hello <b>Please Find the Attached Copy of form sumitted by </b>".$Contact_Name);


    if($mailer->send()) {
    echo "Email has been sent to ".$Email."\n and" ; }
    echo "error in email\n";
    echo "\nCC has been sent to ".$CEmail ;
    else{echo "\nerror in email CC was not sent to ".$CEmail;}!
    the problem is that when user click submit button he/or she is redirected to home page (which i dont want)with executing if and else statements in email code shown above

    please help me how can I stop redirecting to home page.

    you can see screenshot of redirected page from my dropbox


  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,912 Times in 4,873 Posts
    The code you show us is not redirecting to any page. You are not showing us all the code.

    And showing us an IMAGE of a page is useless. Show us the LIVE page.
    Be yourself. No one else is as qualified.


    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts