php - Why dosn't facebook like this code? -


I made some progress to share something which is linking my website that is dynamically from mysql database I can include an iframe on the main page of my site.

  & lt; Iframe src = "// www.facebook.com/plugins/like.php? href=http://www.webaddress.com.au/description.php%3Fid%3D'.id=&width& ; Amp; layout = standard & amp; amp; act = like & amp; show_faces = true & amp; share = true & amp; amp; height = 80 & amp; amp; idid = 596610807121620 \ "scrolling =" no "framesbread = "0" style = "border: none; overflow: hidden; height: 80px;" allowTransparency = "true" & gt; & Lt; / Iframe & gt;    

Then on the page, I have a link to the following metatags.

  & lt; meta property = "og: title" content = "listed in the two-year old section" /> & Lt; Meta Property = "ogg: url" content = "& gt; php echo $ _SERVER ['PHP_SELF'] ;? & gt;" / & Gt; & Lt; Meta Property = "OG: Details" content = "& gt; php echo $ row ['horsename'] ;? & gt;" />    

Is there another Facebook way to do this? As it seems, sometimes work happens but not all the time?

Thank you

Firstly, do you think Facebook no Like this code?

Since you are saying that it sometimes works and not others, I'm guessing that the problem is that you are generating invalid HTML in some cases. Whenever you use text in the context of HTML, you have to save it. htmlspecialchars () can do this for you.

  & lt; Meta property = "og: url" content = "& lt; php echo htmlspecialchars ($ _ SERVER ['PHP_SELF']) ;? & gt; / / & gt; & Lt; Meta Property = "OG: Details" content = "& lt ;? Php HQ HTML Specialtors ($ line ['horse's name']) ;? Gt;" />   

I can also recommend using a template engine because it gets very busy on your busy pages if there is too much dynamic content on your pages.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -