Skip to content

Instantly share code, notes, and snippets.

@vincent4vx
Created March 26, 2013 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincent4vx/5248971 to your computer and use it in GitHub Desktop.
Save vincent4vx/5248971 to your computer and use it in GitHub Desktop.
Exemple pour RpgApi.php
<!-- Fichier vote.php -->
<?php
//inclut le fichier de l'api
include 'RpgApi.php';
//initialise l'api
$api = new RpgApi($id_rpg);
?>
<form action="voteok.php" method="post">
<?php echo $api->getCaptcha()?><!-- affiche le captcha de rpg -->
<input type="submit" value="Voter !"/>
</form>
<!-- FIN vote.php -->
<!-- Fichier voteok.php -->
<?php
//inclut le fichier de l'api
include 'RpgApi.php';
//initialise l'api
$api = new RpgApi($id_rpg);
//envoi le vote à rpg paradize et regarde si il est bon
if($api->submitVote()){
//ajoute les points ici...
echo 'Vote Ok';
}else
echo 'Captcha incorrect !';
<!-- FIN voteok.php -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment