Aug 8, 2008

Loading Some Of The Title From The Include Tag

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Loading Some Of The Title From The Include Tag

Amezis
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

Reply

electriic ink
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

 

 

 


Reply

HmmZ
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 )

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : loading title tag

  1. A Monthly Web Title Script - (7)
  2. Help Php: How To Load String From Text File (solved) - Loading string from text file when you click on your link (9)
    I learned the way to load other files with the code posted on this forum. Now i wanted to try
    something for my side menu. I am calling this a string, --> $tekst , maybe it's
    called something else i'm not sure Now let's say i have a file called details.txt In that
    file i would like to have something like this $detailsaboutphp1 = ("details details details
    1"); $detailsaboutphp2 = ("details details details and even more details 2"); How to make a
    code that loads those $strings on click of a mouse. When we tried to load extern...
  3. Page Loading Time - how long does your page take to load? (7)
    All you have to do is add this code to your page where you want the loading time to be shown, the
    bottom is the most common place. CODE <?php $loadbegintime = microtime();
    $loadbeginarray = explode(" ", $loadbegintime); $loadbegintime =
    $loadbeginarray[1] + $loadbeginarray[0]; $loadendtime =
    microtime(); $loadendarray = explode(" ", $loadendtime);
    $loadendtime = $loadendarray[1] + $loadendarray[0];
    $total_script_time ...
  4. Page Loading Time V2 - how long does your page take to load? (3)
    As my knowledge of PHP increases, I have learned more, in this version, I use a class. V1:
    http://www.trap17.com/forums/page-loading-time-t4782.html CODE <?php class microtimer { //
    Starts, Ends and Displays Page Creation Time     function getmicrotime() {
            list($usec, $sec) = explode(" ", microtime());
            return ((float)$usec + (float)$sec);     }     
        function s() {         $this->st = $this->getmicrotime();
        }          fun...
  5. Loading Mysql Data Into A Table - (10)
    Hey i have a little problem with my php script. i dont really know how to make it work ^^; I want to
    have this exact table: ' I made mysql table that has one column for id(auto-increment,
    primary key), and then it has row and collumn and text. row means which row in the html table and
    collumn wich collum. (obviously /tongue.gif" style="vertical-align:middle" emoid=":P" border="0"
    alt="tongue.gif" />) here is the mysql table screenshoted from phpMyAdmin: r means row and c
    collumn /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue...



Looking for loading, title, include, tag

Searching Video's for loading, title, include, tag
advertisement



Loading Some Of The Title From The Include Tag



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE