View pdf in another browser tab with php

Asked

Viewed 1,218 times

3

Good Afternoon everyone,

Next, I created a php budget form and I request that the user when visiting my site, can request the quote and send it to my database. So I would like it, as soon as it click send(Remembering that when sending already 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 my folders on the site. Could someone help me?

1 answer

1

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');

Browser other questions tagged

You are not signed in. Login or sign up in order to post.