Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had this same problem a week ago. </p> <p>First of all I noticed your URL has an ampersand preceding the parameter string, but it probably needs to have a question mark instead to begin the parameter string, followed by an ampersand between each additional parameter.</p> <p>Now, you do need to escape your URL but also double-escape the URL parameters (title or other content you need to provide content in the Share) you are passing to the URL, as follows:</p> <pre><code>var myParams = 't=' + escape('Some title here.') + '&amp;id=' + escape('some content ID or any other value I want to load'); var fooBar = 'http://www.facebook.com/share.php?u=' + escape('http://foobar.com/superDuperSharingPage.php?' + myParams); </code></pre> <p>Now, you need to create the above-linked superDuperSharingPage.php, which should provide the dynamic title, description, and image content you desire. Something like this should suffice:</p> <pre><code>&lt;?php // get our URL query parameters $title = $_GET['t']; $id = $_GET['id']; // maybe we want to load some content with the id I'll pretend we loaded a // description from some database in the sky which is magically arranged thusly: $desciption = $databaseInTheSky[$id]['description']; ?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;&lt;?php echo $title;?&gt;&lt;/title&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt; &lt;meta name="title" content="&lt;?php echo $title;?&gt;" /&gt; &lt;meta name="description" content="&lt;?php echo $desciption;?&gt;" /&gt; &lt;!-- the following line redirects to wherever we want the USER to land --&gt; &lt;!-- Facebook won't follow it. you may or may not actually want || need this. --&gt; &lt;meta http-equiv="refresh" content="1;URL=http://foobar.com" /&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;&lt;?php echo $desciption;?&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="image_a_&lt;?php echo $id;?&gt;.jpg" alt="Alt tags are always a good idea." /&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="image_b_&lt;?php echo $id;?&gt;.jpg" alt="Make the web more accessible to the blind!" /&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Let me know if this works for you, it's essentially what did for me :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload