Dynamic sites - <title> change

General discussions related to php

Moderators: macek, egami, gesf

TheSameFace
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Jan 21, 2003 7:29 am

Dynamic sites - <title> change

Postby 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:

This might help

Postby meannate » 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>

TheSameFace
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Jan 21, 2003 7:29 am

Thanks for help

Postby TheSameFace » Tue Jan 21, 2003 2:19 pm

Thnx

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

Postby Joan Garnet » Tue Jan 21, 2003 2:43 pm

Fourth.....

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

Re: This might help

Postby WiZARD » 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>


Return to “PHP General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron