【问题标题】:Create dynamic social network share Button创建动态社交网络分享按钮
【发布时间】:2013-11-02 09:11:03
【问题描述】:

我的目标是在求职者网站上创建一个社交网络分享按钮。

这个想法是根据代理和职位ID发布职位,所以我想在社交网络上分享这个职位。

示例

分享按钮

<a href="https://twitter.com/intent/tweet?source=webclient&text=<?php echo "You may have experience of the following: Junior Web Developer, Technical Support, .Net, PHP, C#, Trainee Developer, IT Support, Helpdesk, Web Designer, Content Manager, CMS, Wed Editor, ASP.Net, VB.Net, Online Content Editor etc."."     ".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']?>">SHARE</a>

预期结果示例

您可能具有以下方面的经验:初级 Web 开发人员、技术支持、.Net、PHP、C#、实习开发人员、IT 支持、帮助台、Web 设计师、内容管理器、CMS、Wed 编辑器、ASP.Net、VB。网络、在线内容编辑器等 dayjob.com/?j=4&Agent=rayJ345

==

问题是,当单击此按钮时,它会产生类似这样的内容,其中 dayjob.com/?j=4 之后的任何内容都被消除或不包括在内。

简而言之,我得到的是 dayjob.com/?j=4 而不是 dayjob.com/?j=4&Agent=rayJ345

提前谢谢你。

【问题讨论】:

    标签: php href social-networking share-button


    【解决方案1】:

    您需要对您传递的字符串进行 urlencode。试试这个:

    <a href="https://twitter.com/intent/tweet?source=webclient&text=<?php echo rawurlencode("You may have experience of the following: Junior Web Developer, Technical Support, .Net, PHP, C#, Trainee Developer, IT Support, Helpdesk, Web Designer, Content Manager, CMS, Wed Editor, ASP.Net, VB.Net, Online Content Editor etc."."     ".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>">SHARE</a>
    

    但也要记住,推文的长度不应超过 140 个字符。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-26
      • 2012-01-29
      • 1970-01-01
      相关资源
      最近更新 更多