0

Hi folks,

I want to open a pdf stored in the database in a new window using php server side script. Actually I want store the file name in data table, which user clicks. So i need a server side script open the things in new window along with the file name... So please help me to do the same...

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by jithusdani
0

As far as I know, PHP cant open a new window. What you can do is to have php print the relevant link in html which when clicked directs a user to the page where the pdf file will be viewed with the appropriate parameters passed by the get method.

$get_parameters="action=view&file=filename.pdf";
echo "<a href='view.php?$get_parameters' target='_blank'>click to view</a>";

For the script that receives, you can get the parameters as below

$action=$_GET['action'];
$file=$_GET['file'];
0

wow thanks a lot its worked fine thanks a lot sureronald


As far as I know, PHP cant open a new window. What you can do is to have php print the relevant link in html which when clicked directs a user to the page where the pdf file will be viewed with the appropriate parameters passed by the get method.

$get_parameters="action=view&file=filename.pdf";
echo "<a href='view.php?$get_parameters' target='_blank'>click to view</a>";

For the script that receives, you can get the parameters as below

$action=$_GET['action'];
$file=$_GET['file'];
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.