Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Loading Some Of The Title From The Include Tag
Amezis
post Aug 19 2005, 01:21 PM
Post #1


Privileged Member
*********

Group: Members
Posts: 535
Joined: 14-February 05
From: Oslo, Norway
Member No.: 3,759



Let's say I have the same PHP script on all pages, with the same menus, footer etc, but with different content. The PHP page is called "Sitename - ", and the included pages (which is in HTML) is called "Thingy". I want it to load both titles, so the title will be "Sitename - Thingy". The second page have the same PHP code (with the normal title, "Sitename - "), but is called "Why not?". This one have the title "Sitename - Why not?".

Hope you understand what I want, and that you can help me. smile.gif
Go to the top of the page
 
+Quote Post
electriic ink
post Aug 19 2005, 01:36 PM
Post #2


Incest is a game the whole family can play.
Group Icon

Group: [MODERATOR]
Posts: 1,227
Joined: 11-February 05
From: Heaven
Member No.: 3,709



So you have a header file containing all of the content between the <head> </head> tags but you want to make it so that you can still include the file but have different content between the <title></title> tags?

If I am right, this is how I would do it, but it requires php:

Your header.php file
CODE

<html>
<head>
  <title> Sitename - <? echo $pagetitle; ?>
  </title>
 </head>

<!-- Some over stuff -->


An example webpage
CODE

<?

$pagetitle = "Black Widgets";
include "header.php";

/* Some other stuff */

?>


Now between the <title> tags on our webpage there is Sitename - Black Widgets.

I use the same idea on my website smile.gif

Edit: Mistyped some code

This post has been edited by cmatcmextra: Aug 19 2005, 01:38 PM
Go to the top of the page
 
+Quote Post
HmmZ
post Aug 19 2005, 02:37 PM
Post #3


Super Member
*********

Group: Members
Posts: 362
Joined: 2-March 05
From: The Netherlands
Member No.: 4,097



Great to see other people who know enough about php too smile.gif

(it may be bad for my hosting credits tho sad.gif, gained alot by answering php qustions biggrin.gif )
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Faster Page Loading...(18)
  2. How Long U Play Cod?(23)
  3. Php Include Root Ref(6)
  4. Change / Modify The Title Bar Text In IE6 Or FF(3)
  5. Kitten Born With Only One Eye And No Nose(27)
  6. Include File.php?id=something(13)
  7. Tales Of "insert Your Rpg Title" Game Collection(5)
  8. How Do You Stop A Girl From Liking You?(42)
  9. How To Lock A Folder And Keep It Private(21)
  10. Looking For New Mmorpg Relatively Like Runescape(12)
  11. Loading File Into Blob Fields To Mysql(1)
  12. Problem With Firefox, Latest Version, Not Loading Pages(4)
  13. Harry Potter: The Deathly Hallows(18)
  14. Hitman(4)
  15. Website Not Loading?(31)
  1. Does Php Include Work?(17)
  2. How Do I Include A Php Sidebar In My Website?(5)
  3. Question About Php Includes(17)
  4. Firefox Not Loading Java(1)
  5. A New Webcomic(11)
  6. Loading Linux(5)
  7. Php - Forms, Date And Include(0)
  8. Server Problem?(11)
  9. Php Allow Url Include Question!(10)
  10. Php Auto Website Title(8)
  11. Another Boring New Member Introduction(6)
  12. A List Of Animals And Their Meaning(1)
  13. Modifying The Topic Titles: To Be Or Not To Be?(3)


 



- Lo-Fi Version Time is now: 7th October 2008 - 09:48 PM