我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

使用php动态更改og:url

Can I change meta tags dynamically

<meta property="og:url" content="http://www.someurl.com/948116"/>

so that when I go to test on https://developers.facebook.com/tools/debug/sharing/ it shows the change there? I already tried with JavaScript but sharing debugger shows static data.

Like this

<?php 
$url = "http://your_url";
echo "<meta property='og:url' content='$url'/>";
?>

Facebook does not parse JavaScript, it is not possible to use dynamic OG Tags.

近期文章

  • 从动态表单帖子中收集和格式化数据
  • 无法在本地网络中获取http标头
  • 如何通过jQuery(ajax)跟踪提交给服务器的请求的进度?
  • 使用strtotime()和设置时区问题
  • Ajax Post没有返回正确的值
  • 如何在Mysql PHP中匹配字符串中的值
  • Zend Expressive - 注入中间件的最佳方式
  • 如何在登录后重定向到请求的URL
  • 如何从队列中只读取一次消息
  • 如何使用循环读取PHP中的XML文件的文档行?
  • 如何将字符串设置为数组并设置数组最大值
  • 通过mysqli搜索忽略非字母数字字符
  • php mysql查询输出文件
  • 使用php运行Javascript代码
  • 对数组进行排序并获取密钥
  • php pdo sql如果存在行则返回
  • PHP数组到jquery选择框
  • 为什么这个date_diff不起作用?
  • 坚持等级检查消息的“if”[关闭]
  • 如何在mysql中连接字段表格

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华