tags:

views:

43

answers:

1

Hi,

I am developing pages in php dynamically i.e data gets filled up from mysql DB. how do i assign a proper meta data and description for these dynamic pages so that google recognises it properly.

What needs to be passed in page so that google takes description properly. when i search a page in google. it takes the data in page as description not description tag contents

+2  A: 

<meta name="description" content="<?php echo $your_meta_description ?>" />

mononym
but when i am building a page .i build only body part and the head section is included which is a single file.
pradeep
then you need to look at your ordering, assign the meta data BEFORE your header is included.
mononym
@mononym - i will explain my structure . say i have a page called index.php .. it will look like <?php include('header.php); echo 'this is body part';include('footer.php); ?>so header contains all header part. so from body section can i set the meta description?
pradeep
no, but you can do:<?php $meta = 'description'; include('header.php); echo 'this is body part'; include('footer.php); ?>
mononym