Prophet.K 0 Report post Posted May 6, 2008 This simple PHP function is pretty handy if you want your websites pages in the title without having to name individual ones.It will look like: MyWebsite | Index Quote:MyWebsite | Gallery Quote:MyWebsite | Forumsetc..paste the code into your "functions" file, or any webpage which is included in every page you have(Reminder: To include a webpage, use 'include("webpage.php");')You can of course put the function in each page, but that's just annoying .. then, in each webpage you want the title to appear, putCode:<?phpinclude("the_function_webpage");title();....?>I've quoted each line to show the people who don't do PHP, how the function works a little betterfunction title() { $page = $_SERVER["PHP_SELF"]; // Set variable $page as the current webpage $page = str_replace(".php","",$page); // Remove the .php ending from the string: $page $page = str_replace("/","",$page); // Remove the / before the website name $page = ucwords($page); // Capitalize the first letters echo '<title>MyWebsite | ' .$page. '</title>'; // Change "MyWebsite" to your website name} Share this post Link to post Share on other sites
bluechip 0 Report post Posted May 7, 2008 Very helpful! I think u you shoulda posted it under how-tos. Anyway I thank you for such info.I wanted to ask if u know how I can inset that small icon that appears in the browser on the address bar. I want my site to display such a thing. Help! Anybody? Share this post Link to post Share on other sites
sunshineseeker 0 Report post Posted May 18, 2008 Very helpful! I think u you shoulda posted it under how-tos. Anyway I thank you for such info.I wanted to ask if u know how I can inset that small icon that appears in the browser on the address bar. I want my site to display such a thing. Help! Anybody? Always wondered the same thing! Will now do one for site i'm currently building. Not a php thing tho.http://www.chami.com/tips/internet/110599I.htmland the same 16x16 icon can be displayed when user bookmarks you page, apparantly http://forums.xisto.com/no_longer_exists/ Share this post Link to post Share on other sites
kobra500 1 Report post Posted May 18, 2008 you have to create an Icon "favicon.ico 16px x 16px and upload it somewhere! Try google they will tell you! Share this post Link to post Share on other sites
Bayuugan 0 Report post Posted May 31, 2008 very interesting thread u have there.Now i learn 1 new thing in PhP :DTHANKS!!! Share this post Link to post Share on other sites
bluedragon 0 Report post Posted June 9, 2008 thanks.. I was looking for something like this Share this post Link to post Share on other sites
gogoily 0 Report post Posted June 11, 2008 Thanks, it really helps a lot Share this post Link to post Share on other sites
hitmanblood 0 Report post Posted June 11, 2008 lol I was usually either writing it to every different page or just using some get variable since sometimes I build sites that are accessible only trough index and then when they in fact click on the link link looks something like this index.php?page=about so it initializes variable page with the name content about and you are able to access any page you wuild with this also variable is accessible trough $_GET['page'] simple as that.But in the end I must admit your solution is a lot more elegant. However I see that there might be some problems if one page is include in the other one and is also accessible on its self. And one other problem is if you have php files name in different way then the paeg names. Also what happenes when you've got there get variables I think that it gots distorted. Well these are just thoughts someone might shed some light on it. best regards Share this post Link to post Share on other sites
minimcmonkey 0 Report post Posted June 26, 2008 yea, i have used a small icon for favorites menus, you need to create an icon, 16x16 px.Then you have to upload it somewhere, and in some cases, create a CSS file to tell the browser where to find the file.I cant remember how to do it exactly, google it, there areseveral tutoials on how to do it... I wanted to ask if u know how I can inset that small icon that appears in the browser on the address bar. I want my site to display such a thing. Help! Anybody? Share this post Link to post Share on other sites