From 2eea40619d39d811d105d5a186bde334204d9ed3 Mon Sep 17 00:00:00 2001 From: Chouchen Date: Tue, 4 Jan 2011 10:19:57 +0000 Subject: [PATCH] Bookmarklet checker --- trunk/add.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 trunk/add.php diff --git a/trunk/add.php b/trunk/add.php new file mode 100644 index 0000000..605a740 --- /dev/null +++ b/trunk/add.php @@ -0,0 +1,33 @@ +shortThisUrl($url, $s); + +if(is_bool($ret) && !$ret){ + echo 'alert("'.ShortURL::STATE_ERROR.'");'; + exit; +} +elseif($ret === ShortURL::STATE_ALREADY_EXIST){ + echo 'alert("'.$ret.'");'; + exit; +} +else{ + echo 'alert("Raccourci créé : http://'.$_SERVER['SERVER_NAME'].$folder.rawurlencode($newname).'");'; + exit; +} \ No newline at end of file