<?php
/*
/* Auteur : Mr Xhark
/* URL : http://blogmotion.fr
/* Contact : blogmotion@gmail.com
/* Version : 1.1, rel. 21/12/2009
/* Licence : Creative Commons
/* http://creativecommons.org/licenses/by-nc-sa/2.0/fr/
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Goo.gl generator</title>
<style type="text/css">
<!--
body { font-family:'Lucida Grande',Verdana,'Lucida Sans Regular','Lucida Sans Unicode','Arial','sans-serif'; }
.bloc { margin-left:auto;margin-right:auto; }
-->
</style>
</head>
<body>
<div class="bloc">
<form id="blogmotion.fr" name="blogmotion.fr" method="post" action="">
<label>
URL :
<input name="url" type="text" id="url" value="
<?php if ( !empty($_POST['url']) ) echo htmlspecialchars($_POST['url'], ENT_QUOTES); ?>" style="width:258px" />
</label>
<?php
require_once('recaptchalib.php');
$publickey = 'votre_cle_publique_ici';
$privatekey = 'votre_cle_privee_ici';
echo recaptcha_get_html($publickey); ?>
<label>
<input type="submit" name="button" id="button" value="Goo.gliser" style="width:315px" />
</label>
</form>
<?php
if ( isset($_POST["recaptcha_response_field"]) ) {
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
# captcha incorrect
if (!$resp->is_valid) {
die ("<strong>Le code de sécurité est invalide. Merci d'essayer à nouveau" .
"<br />(reCAPTCHA dit: " . $resp->error . ")</strong>");
}
# captcha correct
$url_goo = $obj->{'short_url'};
echo '<br /><input type="text" value="' . $url_goo . '"/> (url compressée)';
} // POST
?>
<br /><br />
Script by Mr Xhark : <a href="http://blogmotion.fr" title="Blogmotion">Blogmotion.fr</a><br />
Modified by Francis Besset : <a href="http://www.apercite.fr" title="Apercite">Apercite.fr</a>
</div>
</body>
</html>