PHP Function in Facebook "Share" link
Posted: Sun Apr 11, 2010 1:21 pm
I'm trying to put a "share this" link to facebook...
I can use this format
http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>
So my link would look something like this
<a href="http://www.facebook.com/sharer.php?u=ht ... r.org&t=My GPA is <?php echo $_POST['gpa']; ?>">Share your GPA on Facebook</a>
But I get a syntax error when I try to place the link here
Can you please help me post the link correctly
I can use this format
http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>
So my link would look something like this
<a href="http://www.facebook.com/sharer.php?u=ht ... r.org&t=My GPA is <?php echo $_POST['gpa']; ?>">Share your GPA on Facebook</a>
But I get a syntax error when I try to place the link here
Code: Select all
if ($cc>$tc) { //means all steps have been completed
$gpa = $points / $credits;
echo "<hr /><div align='center'><p class='results'>Your GPA is $gpa!<br /><a href="http://www.facebook.com/sharer.php?u=http://www.gpacalculator.org&t=My GPA is <?php echo $_POST['gpa']; ?>">Share your GPA on Facebook</a></p>";
if ($gpa>=3.5) {
echo "<p><b>Congratulations! You've achieved the Honor Roll!</b></p>";
}