how could i disply HTML files titles and urls?

Discussion in 'PHP' started by brokensoft, Feb 1, 2007.

  1. #1
    how could i disply HTML files titles and urls?
    Say file title is welcome in DP, url "mysite.com/welcome-in-DP.html".

    how to disply title and url between body tags like:
    hay visitor welcome in DP
    you are in mysite.com/welcome-in-DP.html
     
    brokensoft, Feb 1, 2007 IP
  2. alecs

    alecs Well-Known Member

    Messages:
    156
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Didn't quite understand you, but:

    for the url use $_SERVER['REQUEST_URI']
    for the title... that's already on the page
     
    alecs, Feb 1, 2007 IP
  3. brokensoft

    brokensoft Active Member

    Messages:
    214
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    i have .html file "welcome-in-DP.html" with a title "welcome in DP"
    i want to disply title and url in my .html file body.
    to be:
    you are in "title here".
    link this page "url here"
     
    brokensoft, Feb 1, 2007 IP
  4. Codythebest

    Codythebest Notable Member

    Messages:
    5,764
    Likes Received:
    253
    Best Answers:
    0
    Trophy Points:
    275
    #4
    Just use PHP includes, should be ok if I understand well

    title.inc.php is title
    url.inc.php is url

    and

    myPage.php is

    You are in <?php include("title.inc.php"); ?><P>
    Link this page <?php include("url.inc.php"); ?>

    Make sense?
     
    Codythebest, Feb 1, 2007 IP
  5. pixel_perfect

    pixel_perfect Banned

    Messages:
    238
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    then open in an editor and write it? if its not a PHP file.
     
    pixel_perfect, Feb 3, 2007 IP
  6. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #6
    
    $page = 'mysite.com/welcome-in-DP.html';
    $do_replace = array('-','_','.');
    $temp_page = explode('.',basename($page));
    
    $final_page = str_replace($do_replace,' ',$temp_page);
    
    echo "hay visitor welcome $final_page<br/>";
    echo "you are in $page";
    
    PHP:
    Peace,
     
    Barti1987, Feb 3, 2007 IP