Jump to content

How to take description of page in <meta>


vinsb

Recommended Posts

Hello,

So I'm trying to take take description of content when I share it but can't figure out how.

I have this:

$currid = $line[0];
            if (isset($_GET['id'])) {
                do {
                    $currid = $line[0];
                    if ($currid == $_GET['id']) break;
                    $previd = $currid;
                    $line = mysqli_fetch_array($result, MYSQL_BOTH);
                } while ($line);
            }

            if ($line) {
                echo "<h1>".$line['caption']."</h1><br />";
            ///rest of code

And trying with this but content is empty. If I $_GET['id'] is ok and I get ID in content.

<meta property="og:description" content="<?php echo $_GET[$line['content']];?>" />

Can anyone help me with this?

Link to comment
https://forums.phpfreaks.com/topic/287156-how-to-take-description-of-page-in/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.