#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0

    Include keywods description and title for each page different


    include keywods description and title for each page differently it is giving me headache i have a database name pages it has 6 columns id,name,title,description,keywords ,status.


    PHP Code:
    <?php // Set document: include ('config/setup.php'); if(!isset($_GET['page'])) { $pg= 'page'; }else{ $pg= $_GET['page']; } ?>
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > <head> <title>help</title> <meta name="description" content="." /> <meta name="keywords" content=" " /> </head> <body> <!-- Header Start --> <div id="logo"> <a class="logo" =pic"> <div class="right"> <?php include('template/right_logo.php');?> </div> </div> <div id="header"> <?php include('template/header.php');?> </div> <!-- Header End --> <!-- Main Start --> <div id="main"> <!-- ### Main Left Start ### --> <div id="left"> <?php //include('content/'.$pg.'.php'); $q="SELECT*FROM pages WHERE name='$pg' "; $r=mysqli_query($dbc,$q); $page= mysqli_fetch_assoc($r); echo '<div class="content_body">'.$page['body'].'</div>'; ?> </div> <!-- ### Main Left End ### --> <!-- ### Main Rigt Start ### --> <div id="right"> <?php include('template/right.php');?> </div> <!-- ### Main Rigt End ### --> <div class="clear"></div> <div id="footer"> <?php include('template/footer.php');?> </div> </div> </div> <!-- Main End --> </body> </html>
    Last edited by slayboy; October 4th, 2012 at 05:04 PM. Reason: formating the php code and the html one
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,850
    Rep Power
    6351
    Your question now? It's your first post.

    What have you tried so far? Are keywords and titles part of your database design?

    The New User Guide will help you in a number of ways.

    Edit: cross-posted to PHPFreaks
    Last edited by ManiacDan; October 4th, 2012 at 03:15 PM.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0

    title and description


    my code is working like when i change from homepage to about page and so on for the content and i have a database with the name pages and has 6 columns with the title and description included thanks for replying can you show me how i can get this done i do understand why you directed to me that link but remember Google showed me this forum
    Last edited by slayboy; October 4th, 2012 at 04:06 PM. Reason: editing an error
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    47
    Rep Power
    2
    Originally Posted by ManiacDan
    Your question now? It's your first post.
    He was continuing off his subject line. He said what he was trying to do "Include keywods description and title for each page different" He than proceeded with his question... "my question now is..." You don't have to jump everyone's bones all the time. Relax.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0
    ok fine was trying to give more details keywords title and description was the quiz dnt be rude
  10. #6
  11. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,850
    Rep Power
    6351
    Your code is now no longer readable.

    If you have the data in your data model, go look at the function which renders the main page body. Use a very similar function to fetch and display the page title. Put that function inside the <title> tags. Same with meta keywords and whatever else you need.
    Last edited by ManiacDan; October 4th, 2012 at 10:21 PM.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    0
    ok fine will try to do that now

IMN logo majestic logo threadwatch logo seochat tools logo