General discussions related to php
Moderators: macek, egami, gesf
by 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

-
- Posts: 5
- Joined: Tue Jan 21, 2003 7:29 am
by 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

-
- Posts: 8
- Joined: Mon Nov 04, 2002 12:06 pm
- Location: West Los Angeles
-
by TheSameFace » Tue Jan 21, 2003 2:19 pm
Thnx
-
TheSameFace
- New php-forum User

-
- Posts: 5
- Joined: Tue Jan 21, 2003 7:29 am
by Joan Garnet » Tue Jan 21, 2003 2:43 pm
Fourth.....
-

Joan Garnet
- Moderator

-
- Posts: 387
- Joined: Sat Aug 03, 2002 2:56 am
- Location: Mars
-
by 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>
-

WiZARD
- 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: No registered users and 1 guest