Skip to content

Instantly share code, notes, and snippets.

@jordanduncan221
Created December 5, 2010 11:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jordanduncan221/729021 to your computer and use it in GitHub Desktop.
Save jordanduncan221/729021 to your computer and use it in GitHub Desktop.
Very clean and simple Facebook like script
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
<head>
<title><?php $quote = strip_tags($_GET['p']); print stripslashes($quote) ?></title>
<style type="text/css">
body {
background: #45A2D0;
color: #333;
font-family: "Myriad Pro";
text-align: center;
}
#main {
margin: 20px auto 0 auto;
width: 805px;
font-size: 38px;
text-shadow: #98CCE5 0px 1px 0px;
}
#like {
margin: 10px auto 0 auto;
padding: 5px;
width: 460px;
background: #327A9D;
border: 1px solid #246B8F;
border-radius: 3px;
}
#input {
margin: 0 auto 0 auto;
font-size: 22px;
width: inherit;
}
TEXTAREA {
width: 350px;
height: 150px;
background: #F5F5F5;
border: 1px solid #CCC;
border-radius: 5px;
font-family: "Myriad Pro";
font-size: 16px;
margin: 10px 0 0 0;
}
</style>
</head>
<body>
<div id="main">
<?php
$quote = strip_tags($_GET['p']);
print stripslashes($quote);
?>
<div id="like">
<?php
if(isset($_GET['p'])){
print '<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="'.curPageURL().'" layout="standard" show_faces="true" width="450"></fb:like>';
}
?>
</div>
<div id="input">
<form action="like.php" method="GET">
What Do You Like?<br />
<textarea id="quoteinput" name="p"></textarea><br />
<input type="submit" width="120" value="I Like It!">
</form>
</div>
</div>
</body>
</html>
@vikalrudra
Copy link

not reliable

@mayurhajare123
Copy link

<title></title> <style type="text/css"> body { background: #45A2D0; color: #333; font-family: "Myriad Pro"; text-align: center; } #main { margin: 20px auto 0 auto; width: 805px; font-size: 38px; text-shadow: #98CCE5 0px 1px 0px; } #like { margin: 10px auto 0 auto; padding: 5px; width: 460px; background: #327A9D; border: 1px solid #246B8F; border-radius: 3px; } #input { margin: 0 auto 0 auto; font-size: 22px; width: inherit; } TEXTAREA { width: 350px; height: 150px; background: #F5F5F5; border: 1px solid #CCC; border-radius: 5px; font-family: "Myriad Pro"; font-size: 16px; margin: 10px 0 0 0; } </style>
</script>'; }

?>

What Do You Like?
<textarea id="quoteinput" name="p"></textarea>

@ashukak
Copy link

ashukak commented Jun 10, 2018

need fb timeline likers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment