OsakaWebbie
Programmer
Hopefully an easy question. I have an application in a subdirectory, whose favicon is different from that of the parent directory so I have to link it explicitly. For normal code that echoes HTML, I can just do this (outside PHP, or with an echo statement):
But in one file I generate a PDF that I then send to the browser like this:
In this case, how do I specify the favicon? I've looked all over the internet for the syntax of header() for that, but I can't find it.
If it's not possible in header(), perhaps there is another way? Maybe something I can set in php.ini or .htaccess or something - everything in that subdirectory should use the favicon.ico there. (PHP is running as FastCGI.) The server is a VPS, so I have no restrictions on what I can do.
HTML:
<link rel="shortcut icon" type="image/x-icon" href="[URL unfurl="true"]http://mysite.com/subdirectory/favicon.ico">[/URL]
PHP:
header("Content-Type: application/pdf");
header("Content-Transfer-Encoding: binary");
@readfile("$fileroot.pdf");
If it's not possible in header(), perhaps there is another way? Maybe something I can set in php.ini or .htaccess or something - everything in that subdirectory should use the favicon.ico there. (PHP is running as FastCGI.) The server is a VPS, so I have no restrictions on what I can do.