Current location: Hot Scripts Forums » Programming Languages » PHP » Changing page title using PHP and Value from DB


Changing page title using PHP and Value from DB

Reply
  #1 (permalink)  
Old 08-23-04, 07:17 AM
SmartCard SmartCard is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Changing page title using PHP and Value from DB

I'm trying to write a PHP page that takes values from two db fields to
generate the title meta tag from a value in my database. I've got all the
database connection stuff working but the problem is that I can only show
one field info as a title.

The following is working file, where it is getting only the value of
$strBrandName and showing it well.
<title><?php echo $strBrandName + $strModel;?></title>

When I want to combine the value of BrandName and Model it is not working.
<title><?php echo $strBrandName + $strModel;?></title>

I think may be my "+" is wrong!

Can anyone help me please? I've looked in my book and on Google but can't
find any code examples.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 08-23-04, 07:56 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
that's true ..
+ is the Javascript/others operator but in php you can use either comma or dot
PHP Code:

<title><?php echo $strBrandName $strModel;?></title>
or
PHP Code:

<title><?php echo $strBrandName $strModel;?></title>
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 04:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.