Dynamic sites - <title> change

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
TheSameFace

Tue Jan 21, 2003 7:54 am

Hi, how can I change the <title>???</title> on a dynamic page. My site is build using php and mysql DB.
Thnx

meannate
New php-forum User
New php-forum User
Posts: 8
Joined: Mon Nov 04, 2002 12:06 pm
Location: West Los Angeles
Contact:

Tue Jan 21, 2003 12:46 pm

The nice thing about PHP is the ability to integrate with HTML so nicely. Hope this helps!

-Nathan


Code: Select all

<?

if (condition)
{
  $title = "this and that"
}
else
{
  $title = "that and the other"
}

?>
<HTML>
<HEAD>
<TITLE><? echo "$title"; ?></TITLE>
</HEAD>
<BODY>

Blah blah blah...

</BODY>
</HTML>


User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Tue Jan 21, 2003 2:43 pm

Fourth.....

User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Wed Jan 22, 2003 7:56 am

In PHP from 4.x version you may do next:

Code: Select all

<?

if (condition)
{
  $title = "this and that"
}
else
{
  $title = "that and the other"
}

?>
<HTML>
<HEAD>
<TITLE><?=$title; ?></TITLE>
</HEAD>
<BODY>

Blah blah blah...

</BODY>
</HTML>
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests