Welcome Guest, Not a member yet? Register   Sign In
Using a thank you page after creating a pdf
#1

[eluser]rijobo[/eluser]
Hello,

I'm using this plugin to create pdf's:

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $filename, $stream=TRUE)
{
    require_once("dompdf/dompdf_config.inc.php");
    
    $dompdf = new DOMPDF();
    $dompdf->load_html($html);
    $dompdf->render();
    if ($stream) {
        
$dompdf->stream($filename.".pdf");
redirect('checkout/checkout/bedankt','refresh');
    
    } else {
        $CI =& get_instance();
        $CI->load->helper('file');
        write_file("./invoices_temp/invoice_$filename.pdf", $dompdf->output());
    }
}
?>

I thought I could use the redirect to send the users to a thank you page after creating the pdf. But this doesn't work. Does anyone know how I can do this?
#2

[eluser]OES[/eluser]
Been a while since I used the dompdf lib but make the pdf file creation from a link with target="_blank".

Hope this helps !




Theme © iAndrew 2016 - Forum software by © MyBB