Home  >  Q&A  >  body text

No results found for sharing via Twitter (share on mobile only): Error

I have a simple sharing button for Facebo ok, Twitter and 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>

When the user clicks share, it goes to a php file called share.php; this file gets information about the page that will be shared.

if ($share =="tw"){     

header("Location: http://twitter.com/share?text=$seo_description&url=$share_url");
die();
}

On desktop it works fine but on mobile I get the following error

The terms you entered did not bring any results, please try again later.

Facebo k and Pinterest run on mobile and I'm struggling to figure out why I'm getting this.

I'm signed into the same Twitter account on my phone that I'm signed into on my computer.

I got the information for my URL from this question

P粉486743671P粉486743671276 days ago424

reply all(1)I'll reply

  • P粉770375450

    P粉7703754502023-12-08 00:12:03

    I ran this on mobile by changing the link

    if ($share =="tw"){     
    
    header("Location: http://twitter.com/share?text=$seo_description&url=$share_url");
    die();
    }

    Here

    if ($share =="tw"){     
    
    header("Location: https://twitter.com/intent/tweet?text=$seo_description&url=$share_url");
    die();
    }

    reply
    0
  • Cancelreply