Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Facebook Meta Tag - og:description for database value

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Facebook Meta Tag - og:description for database value

Postby maharafa » Mon May 27, 2013 9:27 pm

Facebook Meta Tag - og:description for database value with strip_tags() and substr()

Code: Select all
$descpp = substr($fetchForumData[0]['descp'], 0, 300)."...";
// echo $descrp    {As it shows correctly as the description data from database limit to 300 words via echo}
<meta property="og:description" content="<?php echo strip_tags($descpp); ?>" />   


The following script not working and shows result on facebook as '....' rather than '$descpp + .....'

And I already debug via http://developers.facebook.com/tools/debug also.

And for <meta property="og:description" content="<?php echo $fetchForumData[0]['descp']; ?>" />... its shows complete content on the top of the article page and after comment via facebook comment plugin it shows blank space on facebook timeline.

What is missing? Kindly advice as soon as possible.
maharafa
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon May 27, 2013 9:14 pm

Re: Facebook Meta Tag - og:description for database value

Postby maharafa » Tue May 28, 2013 9:16 am

Any Help? Is anything wrong with the code? or what is the solution?
maharafa
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon May 27, 2013 9:14 pm

Re: Facebook Meta Tag - og:description for database value

Postby johnj » Tue May 28, 2013 9:27 pm

you need to check whether $fetchForumData[0]['descp'] has a value. for that, please do a print($fetchForumData[0]['descp']);
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.