未找到透過 Twitter 分享的結果(僅在行動裝置上分享):錯誤
P粉486743671
P粉486743671 2023-12-07 10:54:26
0
1
427

我有一個簡單的 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粉486743671
P粉486743671

全部回覆(1)
P粉770375450

我透過更改連結在行動裝置上運行了此功能

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();
}
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!