Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP redirect to pdf then navigate to another page?
    primarykey
    data
    text
    <p>I am using php and an apache server. My application gathers data from the user, put's it in a database, then uses PDFLib to display the formatted data back to the user as a pdf. My problem is, I would like the pdf to display as a new page, this works. But, I also have a blank page left up with the URL containing the variables used to display the pdf. I would like this page to show a different summary page, in HTML, without the variables in the URL, but I don't know how to do that. In the code that follows, I am going to the summary page if the medical flag is false. What I would like is to go to BOTH pages if the medical flag is true. Is this possible?</p> <pre><code> if($medical_flag) { header("Location: {$_SERVER['PHP_SELF']}/./index.php?step=wc_pdf&amp;id={$event_id}"); } else { header("Location: {$_SERVER['PHP_SELF']}?step=success&amp;id={$event_id}"); } exit; </code></pre> <p>OK, I understand how this is impossible, but I still haven't figured out how to solve the problem. I thought I could toss the opening of the PDF back at jQuery with something like this:</p> <pre><code>jQuery(document).ready(function () { function display_pdf_page(data, textStatus) { var current_record = data || {}; //somehow display the pdf now } function show_pdf(eventid){ jQuery.getJSON( './inc/get_current_record_data_json.php', {'id': eventid}, display_pdf_page ); } ... }); </code></pre> <p>Then after I process the data in php "call" the above using:</p> <pre><code> echo '&lt;script type="text/javascript"&gt;' , 'show_pdf($event_id);' , '&lt;/script&gt;'; </code></pre> <p>But that doesn't work either, php doesn't know where to find show_pdf. My lack of understanding of client/server side events is killing me here. Call be obtuse... I don't get it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload