Created
December 5, 2010 11:18
-
-
Save jordanduncan221/729021 to your computer and use it in GitHub Desktop.
Very clean and simple Facebook like script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
?>
<textarea id="quoteinput" name="p"></textarea>