我有一個簡單的 Facebo ok、Twitter 和 Pinterest 分享按鈕
<a href="<?php echo "$base_url/share.php"; ?>" class="btn btn-default btn-face book btn-icon btn-block" target="popup" onclick="window.open('<?php echo "$base_url/share.php?id=$id&share=fb&type=article"; ?>','popup','width =600,height=600'); return false;"><i class="fab fa-face book"></i> <span class="post-sharing__label d-none d-sm-inline-block">Share on Face book</span></a> <a href="<?php echo "$base_url/share.php"; ?>" class="btn btn-default btn-twitter btn-icon btn-block" target="popup" onclick="window.open('<?php echo "$base_url/share.php?id=$id&share=tw&type=article"; ?>','popup','width=600,height=600'); return false;"><i class="fab fa-twitter"></i> <span class="post-sharing__label d-none d-sm-inline-block">Share on Twitter</span></a> <a href="<?php echo "$base_url/share.php"; ?>" class="btn btn-default btn-twitter btn-icon btn-block" target="popup" onclick="window.open('<?php echo "$base_url/share.php?id=$id&share=tw&type=article"; ?>','popup','width=600,height=600'); return false;"><i class="fab fa-twitter"></i> <span class="post-sharing__label d-none d-sm-inline-block">Share on Twitter</span></a>
當使用者點擊共享時,它會轉到名為 share.php 的 php 檔案;該檔案獲取有關將要共享的頁面的資訊。
if ($share =="tw"){ header("Location: http://twitter.com/share?text=$seo_description&url=$share_url"); die(); }
在桌面上,它可以正常工作,但在行動裝置上,我收到以下錯誤
The terms you entered did not bring any results, please try again later.
Facebo k 和 Pinterest 在行動裝置上運行,我正在苦苦思索為什麼我會得到這個。
我在手機上登入的 Twitter 帳號與我在電腦上登入的帳號相同。
我從這個問題中得到了我的網址的資訊
P粉7703754502023-12-08 00:12:03
我透過更改連結在行動裝置上運行了此功能
if ($share =="tw"){ header("Location: http://twitter.com/share?text=$seo_description&url=$share_url"); die(); }
到此
if ($share =="tw"){ header("Location: https://twitter.com/intent/tweet?text=$seo_description&url=$share_url"); die(); }