View pdf in another browser tab with php

2

Good afternoon guys,

Next, I created a budget form in php and requested that the user when visiting my site, can request the budget and send it to my database. So I would like it as soon as it clicks on sending (remembering that when sending I redirect to another page in java script) I can already open in a new browser tab a general budget in pdf format that will already be in one of mine folders on the site. can anybody help me?

    
asked by anonymous 17.08.2017 / 19:29

1 answer

0

Use this code, which will open the file in the browser itself. Preferably use Google Chrome.

header("Content-type: application/pdf");
header("Content-Disposition: inline; filename=nome.pdf");
@readfile('files/nome.pdf');
    
17.08.2017 / 19:32