Is there a way to change a page's title with PHP? Basically, I'm making a PHP page to view Flash files on my site, with the Flash filename added as a parameter in the URL. One magic PHP chunk later and the full name is in $ar[0] so I need to add that onto the page title...<head>
<title>$ar[0]</title>
</head>Originally posted by wiffles
Is there a way to change a page's title with PHP? Basically, I'm making a PHP page to view Flash files on my site, with the Flash filename added as a parameter in the URL. One magic PHP chunk later and the full name is in $ar[0] so I need to add that onto the page title...
why can't you just do:
<?
//code here
?>
<html>
<head><title><?=$ar[0]?></title></head>
....If you are trying to get $ar[0] to show up in the title all you have to do is add:
<html>
<head>
<title><? echo $ar[0]; ?></title>
</head>
<body>
Content Here
</body>
</html>
If you are trying to do something else can you please explain a little more?Originally posted by DA Master
<head>
<title>$ar[0]</title>
</head>
rofl..we posted at the exact same time Lol 3 people with the exact same reply .Three posts at the same time, all same answer as well.indeed..it's like the php post gang Originally posted by Paul
Lol 3 people with the exact same reply .
And again, this will have to stop.5 replies in one refresh...
Thanks for help thoNo problem, does it answer your question though?yes, yes it does. And even made another brilliant suggestion (putting the php before the <html>)Originally posted by wiffles
yes, yes it does. And even made another brilliant suggestion (putting the php before the <html>)
note: this also helps if your not using output buffering if you have some sort of php running that requires it to be ran before headers are sent(ie: setcookie) as it comes before any output ^_^
<title>$ar[0]</title>
</head>Originally posted by wiffles
Is there a way to change a page's title with PHP? Basically, I'm making a PHP page to view Flash files on my site, with the Flash filename added as a parameter in the URL. One magic PHP chunk later and the full name is in $ar[0] so I need to add that onto the page title...
why can't you just do:
<?
//code here
?>
<html>
<head><title><?=$ar[0]?></title></head>
....If you are trying to get $ar[0] to show up in the title all you have to do is add:
<html>
<head>
<title><? echo $ar[0]; ?></title>
</head>
<body>
Content Here
</body>
</html>
If you are trying to do something else can you please explain a little more?Originally posted by DA Master
<head>
<title>$ar[0]</title>
</head>
rofl..we posted at the exact same time Lol 3 people with the exact same reply .Three posts at the same time, all same answer as well.indeed..it's like the php post gang Originally posted by Paul
Lol 3 people with the exact same reply .
And again, this will have to stop.5 replies in one refresh...
Thanks for help thoNo problem, does it answer your question though?yes, yes it does. And even made another brilliant suggestion (putting the php before the <html>)Originally posted by wiffles
yes, yes it does. And even made another brilliant suggestion (putting the php before the <html>)
note: this also helps if your not using output buffering if you have some sort of php running that requires it to be ran before headers are sent(ie: setcookie) as it comes before any output ^_^