Results 1 to 1 of 1

Thread: PHP&SQL. dynamic meta content.

Threaded View

  1. PHP&SQL. dynamic meta content.

    I am sure there are more people doing this, for my website I load different meta content trough a database for each and every page.

    Easy and smart!
    PHP Code:
    Page_name 'index';
    PHP Code:
    // we need to connect to our database;
    $result mysql_query("SELECT * FROM pages WHERE Page_name='$Page_name'");
        if (
    $result == false || mysql_num_rows($result) == 0)

    $data mysql_fetch_array($result);
    $meta_description $data['meta_content'];
    $meta_keywords $data['meta_keywords'];
    $page_title $data['Page_title'];
    function to print html header
    PHP Code:
    function HTML_HEAD ($page_title,$meta_description,$meta_keywords)
    '<LINK REL="SHORTCUT ICON" HREF="favicon.ico"/>';
    '<LINK REL="stylesheet" href=style.css" type="text/css" />';
    '     <!--[if IE 6]>
                      <link rel="stylesheet" href="ie6.css" type="text/css" title="IE6" />
    '<script type="text/javascript" src="jv.js"></script>';
    // Meta data
    echo "<meta name='description' content='$meta_description'/>";
    "<meta name='keywords' content='$meta_keywords' />";
    '<meta name="revisit-after" content="1 days" />';
    Last edited by epidemic; 11 January, 2009 at 21:21 PM.

Similar Threads

  1. Dynamic cascading...
    By cranbrook in forum Web Design
    Replies: 0
    Last Post: 5 May, 2011, 10:50 AM
  2. Problem with Dynamic Content Gallery
    By djam in forum Wordpress
    Replies: 1
    Last Post: 28 January, 2011, 11:03 AM
  3. Dynamic website and SEO
    By imported_whitey99 in forum Promoting
    Replies: 1
    Last Post: 14 August, 2009, 13:29 PM
  4. Dynamic website and SEO
    By imported_nikon in forum Promoting
    Replies: 1
    Last Post: 31 May, 2009, 12:04 PM
  5. Looking for a Dynamic Text/Image Replacement
    By Mr.Bill in forum Programming
    Replies: 2
    Last Post: 9 March, 2009, 10:32 AM

Tags for this Thread


Posting Permissions

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