problem with meta keywords in php

Discussion in 'HTML & Website Design' started by real 24, Mar 28, 2006.

  1. #1
    hi everyone,

    i've been trying to figure out how to add keywords using the php code below but i dont know where to add the keywords i.e. thereal24.com, real 24, etc.

    i cant seem to figure out where i would be putting the keywords.:confused:

    any help is appreciated!!:)

    /* since global constants can't be arrays... */
    $keywords = array(); /* List of meta keywords for search engines. The name of the person is automatically added */
    $goodwords = array(); /* An array of words not in the default dictionary, but you would like to have. Usually the person's surname is in here, unless it is a really common one like Smith or Robinson */
     
    real 24, Mar 28, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Well if you are wanting to know how to add key words to the array this is how you do it. But your question is kind of vague. Can you explain a little more in detail as to what you are doing?
    $keywords = array();
    $keywords[] = "thereal24.com";
    $keywords[] = "real 24";
    Code (markup):
     
    Slapyo, Mar 29, 2006 IP
  3. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Quite an understatement I would say.

    Are you asking where META Keywords should go in your PHP code? Why don;t you just put them in HTML?
     
    T0PS3O, Mar 29, 2006 IP
  4. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #4
    That was my intial thought ... META keywords.
     
    Slapyo, Mar 29, 2006 IP
  5. brb

    brb Peon

    Messages:
    42
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I was just coming here to post the same question.:)
    Can you put your meta tags just in HTML and not put it in php for a php website?

    My problem is that my web person did my meta tags, and I cant get my title tags (at least to appear in the blue part of the browser). They appear as the URL.

    I didn't mean to hijack,but was curious about if the meta tags can be in html.
     
    brb, Mar 29, 2006 IP
  6. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #6
    Slapyo, Mar 29, 2006 IP
  7. real 24

    real 24 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    sorry about the vagueness, yeah i am wondering where the meta keywords would go in the PHP code.

    can i put html and PHP coding in the same file?
     
    real 24, Mar 29, 2006 IP
  8. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #8
    Yeah

    <?php
    php code here
    ?>
    html here
    <?php
    php code here
    ?>
    Code (markup):
    You can also echo HTML from php
    echo "<a href=\"mylink.php\">my link</a>";
    Code (markup):
    But you have to escape the quotes in your HTML if you are going to echo it.
     
    Slapyo, Mar 29, 2006 IP
  9. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #9
    Hi. How come you are putting your meta tags in PHP? If this is not for a custom CMS, might I suggest the usage of mixing HTML in PHP and just using some PHP includes to act as dynamic pages? :)
     
    EGS, Mar 29, 2006 IP