I have a website that Facebook users use to get likes on their statuses. The website uses MySQL database to give likes to the users, the default number of limitation of the likes to be sent is 70. What I need is a PHP code that will let the user choose the amount of likes by themselves using the "select" HTML code.
I have already made the form and select codes (demo: jsfiddle.net/U4Ye8) Please see the demo.
The form action is "p.php"
The questions are:
-What code do I need to have in the index.php?
-What code do I need to have in the p.php?
If you need any other info about my question, please comment below.
$output = '';
//get users and try liking
$result = mysql_query("
SELECT
*
FROM
Likers ORDER BY ID DESC LIMIT 70
");
if($result){
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$m = $row['access_token'];
$facebook->setAccessToken ($m);
$id = trim($_POST ['id']);
try {
$facebook->api("/".$id."/likes", 'POST');
$msg1 = "<font color='get'>Success!</font>";
}
catch (FacebookApiException $e) {
$output .= "<p>'". $row['name'] . "' failed to like.</p>";
$msg2 = "<font color='red'>Failed to Like!</font>";
}
}
}