Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8443705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:12:36+00:00 2026-06-10T09:12:36+00:00

I have an html page with a form and a submit button. Once I

  • 0

I have an html page with a form and a submit button.

Once I click submit all the form data, thanks to fpdf, gets turned into pdf.
This pdf is sent without problems to my email.

Building this little page everything always worked without problems and I was able to redirect my user to a thank you page without problems with this code:

header("Location: /thank-you.php",303);
exit();

As soon as I’ve implemented the pdf file save the final redirection stopped working.

I’ve implemented the pdf save easily with fpdf:

$pdf->Output("filename.pdf", "D");

And reading on stackoverflow and all the internet I’ve understood that you can’t send two headers.

I thought about solving the problem with javascript so I put after the pdf generation

echo "<script language=javascript>
window.location = 'thanks.html'
</script>";

but no luck.

The php page simply “stops” when the browser downloads the pdf file.

Any chance to solve this?

EDIT:

All the suggestion I got (thanks to everybody) get me to the same point: use thank you page to handle the pdf save.
Sounds great to me.

I’ve tried preparing a thankyou.php page with a simple $pdf->Output(); in it.
It didn’t work…
So I thought to use an include to my create.php (where happens all the magic: pdf creation, email sending, insert into db etc) with:

<?php
include("create.php");
$pdf->Output();
?>

Still no luck.

What’s wrong with my thinking?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:12:37+00:00Added an answer on June 10, 2026 at 9:12 am

    You should approach this the other way around.

    Send the user to the thanks page, and on that thanks page do $pdf->Output(). That should do what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple registration form. Once all information entered, user click submit button and
i have a submit page in html . when i submit the form data,
I have an HTML page with a simple form. When the user clicks submit,
I have a html form that posts to a new page on submit. If
I have a html page with a form. The form has Div which gets
I have an html file with a form containing a submit button, and an
There is a html form I have which submits to a Servlet once Submit
I have an HTML page with a web form. Among other things, it includes
I have a form that I don't render as part of HTML page but
I have am HTML form in a PHP page. The form has various inputs.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.