Results 1 to 8 of 8

Thread: quick head tag question

  1. #1
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question quick head tag question

    Hi everyone,
    I'm new to php...and can't find anything on "php includes".

    example below:
    <meta name="keywords" content="<? echo "$keywords1";?>">

    I assume that this include is called from a text file. The problem is I can't locate the file...can anyone give me some guidance on what "type" of file I should be looking for or where I might find it?

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by mike21 View Post
    Hi everyone,
    <meta name="keywords" content="<? echo "$keywords1";?>">
    The above would just echo (print in the document) that variable ($keywords1) that was assigned ealier in the script. Not sure what you mean by "What file you should be looking for".
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your post....
    it sounds like your trying to tell me that the 'description' and 'keywords' would go somewhere in the first 4 lines below? If so, could you advise on exact location?

    $description1 = ereg_replace( "\"", "", $description1);
    $description1 = ereg_replace( "&quot;", "", $description1);
    $keywords1 = ereg_replace( "\"", "", $keywords1);
    $keywords1 = ereg_replace( "&quot;", "", $keywords1);

    $today = date ("F-d-Y");
    $today1 = date ("F d, Y");

    $basecolor = "#ffffff";
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title><? echo "$sitenames"; ?></title>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <base href='<? echo "http://$siteurl_class/";?>'>
    <link rel="stylesheet" type="text/css" href="styles.css">
    <meta name="description" content="<? echo "$description1";?>">
    <meta name="keywords" content="<? echo "$keywords1";?>">

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Well, an include does just that; includes code from another place.

    So say you have an input form on one page, lets call it input.php and that input box is where the visitor inputs their name: Michael.

    Then you could use this information later on on another page.

    to use an include you just simply put:

    PHP Code:
    <?php include("http://site.com/input.php"); ?>
    Where ever you want the contents displayed on that page.

    Becareful though, as includes will include the ENTIRE page.

    Perhaps you want Global Variables instead??
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    it sounds like your trying to tell me that the 'description' and 'keywords' would go somewhere in the first 4 lines below?
    $description1 and $keywords1 are already defined before that code. Also, the "keywords" meta tag is redundant, as it provides little or no meta-data about the page that would be helpful to a user, and search engines have ignored it for quite a while now. A general rule of thumb is that if it's relevant enough to merit inclusion as a keyword, it should be in the visible text of your page anyway.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ...ok, so where 'in theory' would I insert a name and description for these includes:

    <title><? echo "$sitenames"; ?></title>
    <meta name="description" content="<? echo "$description1";?>">

    ...do they usually reside in a text file somewhere or should I be looking for Global Variables?
    (there is nothing on the page itself to indicate)

  7. #7
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    If they were being assigned from a text file (or any file for that matter), look for something like:

    include(), require(), fopen(), file(), or any other file system commands such as these. (For full list, see PHP.net)

    Inside the parenthesis (somewhere in there), it would show what file was being included, opened, etc.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  8. #8
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ....this looks like it may lead somewhere.

    global $sitenames, $sitename;
    include('paramlinks.inc.php');

    ...but this file (paramlinks.inc.php) simply references mysql db.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •