Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Change The Name Of The Paging Depending On Db Resu

Recommended Posts

Hi guys, the best way to describe what i want to do is by example so..Say I got a database of people. Say the name of the site is peopledatabase.com(So when u minimise it the site in the taskbar says peopledatabase.com -Microsoft Internet Explorer). Now when i search the db and find a person, i want the name of that page to change to the name of the person found. i.e Information about John Smith - Microsoft Internet Explorer.At the moment the name is the same for every page, anyone got any ideas or examples on solving this problem plz?Many thankskvarnerexpress

Share this post


Link to post
Share on other sites

What I would do is just to do all the database queries before you do any of the html. That way, when you start outputting html, you can put something like "Information about $name" in the <title> tags.

Share this post


Link to post
Share on other sites

I would probably do something like this (similar to what beeseven suggested):

<?php// Obviously, this isn't a real function, just an example.  $result = extract_database_information();  $page_title = $result['page_title'];?><html><head><title><?=$page_title == '' ? '' : $page_title . ' - ';?>Peoplesdatabase.com</title></head><body>...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.