Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Dynamic sites - <title> change

General discussions related to php

Moderators: macek, egami, gesf

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
TheSameFace
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jan 21, 2003 7:29 am

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>
meannate
New php-forum User
New php-forum User
 
Posts: 8
Joined: Mon Nov 04, 2002 12:06 pm
Location: West Los Angeles

Thanks for help

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

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

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

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

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>
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol


Return to PHP General

Who is online

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

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron