Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 703

Generated file in PHP - How to change tab title?

$
0
0

I generate a QR code with PHP. Now, if I want to quickly save them they will be named [php filename].gif, because that's the title you can see in the tab.

Is there a way to change that title? All my research pulls "change the <title> tab in HTML!" when I'm not in HTML anyways.

My current hunch is that I can use a header like when I mention to the browser "this is a gif" by doing header("Content-type: image/gif");, but as I said I cant seem to figure out what is the header that would work for this.

My code is pretty much this example here, as is.

require_once("./lib/qrcode.php");if (isset($_GET['url'])) {    $qr = QRCode::getMinimumQRCode($_GET['url'], QR_ERROR_CORRECT_LEVEL_L);    $im = $qr->createImage(32, 64);    header("Content-type: image/gif");    header("Title: Hello");    imagegif($im);    imagedestroy($im);}else {    header('Location:/');}

The only modification is that it simply checks for an URL attribute that will be the generated QR.


Viewing all articles
Browse latest Browse all 703

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>