Topic awaiting preservation: PHP: accessing title of page? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 01-11-2002 16:32 |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
posted 01-11-2002 16:55
The poster has demanded we remove all his contributions, less he takes legal action. |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 01-11-2002 17:00
yes, but there is html before the php-code. so i thought, there would be a way to read that value. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 01-11-2002 17:06
GRUMBLE: I'm wondering why? Is it your own page? There might be an easier way. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-11-2002 17:31
well, Grumble, there is an overkill solution to this :-) |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 01-11-2002 17:42
emps, yes it is my page. what easier way is there? (i want to add a string which i read out of a mysql-db to my title) code: blabla.com :: random quote :: document title |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 01-11-2002 18:00
GRUMBLE: Well there might not be an easier way but try something like this (I use it a lot): code: <title>My site: <?php echo "$some_text"; ?></title>
|
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 01-11-2002 18:11
ok then, but how do i read/write to it afterwards. content should be filled by a mysql-query which is called in an include AFTER the title-tag. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 01-11-2002 18:20
GRUMBLE: This is where I thought the problems might arise - again this sounds too simplistic but can't you have the include above the <TITLE>? I like to try and keep the HTML and PHP as separate as possible and the majority of the PHP done before the HTML and then drop the PHP into the right places in the HTML. There are just so many different ways of doing this that it might not be very helpful for your approach. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 01-11-2002 18:33
How we do it is assign a basic title, such as "GurusNetwork.com" in the <head>. |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 01-11-2002 18:40
emps, yes i could do the mysql-query before the head, but i was trying to avoid that. |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
posted 01-11-2002 18:41
The poster has demanded we remove all his contributions, less he takes legal action. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-12-2002 00:01
also, you could use my solution and use a title like 'blabla.com :: %%REPLACEME1%% :: %%REPLACEME2%%. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 01-12-2002 01:50
I am having trouble figuring out why you would not want to place the query at the beginning of your document. The only reason I could see you placing it in the middle would be if you were to be pulling in the content from another page and have the code placed in that page, and if this is how you are working it, i would find it much better to then seperate your code and call the code at the beginning of the page as oposed to the middle. |
Maniac (V) Inmate From: Brisbane, Australia |
posted 01-12-2002 01:58
Yeah, I second WarMage's suggestion. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 01-12-2002 05:38
That's not always easy.... |
Nervous Wreck (II) Inmate From: The Lost City Of Atlantis |
posted 01-12-2002 20:50
This might be helpfull...... read me |