require("/srv/www/htdocs/web35/html/twiturl.inc.php"); include("/srv/www/htdocs/web35/html/en/result.php"); // Anlegen if($_REQUEST["new_url"]) { $tmp_url=$_REQUEST["new_url"]; $tmp_code=$_REQUEST["new_code"]; // doppeltes protokoll (http://) filtern if(eregi("http://http://",$tmp_url)) { $tmp_url=substr($tmp_url, 7); } // neue regex, inklusive + und :. if(!preg_match("/^[a-zA-Z]+[:\/\/]+[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%#,&=\?\-\+\~\:;,_]+$/i",$tmp_url)) { $message="Please enter a valid URL!"; $show_url=$tmp_url; } if(eregi("twiturl.de",$tmp_url)) { $message="Want to twiturl yourself? C'mon! ;)"; $show_url=$tmp_url; } // Wunschcode für RP ONLINE reservieren $tmp_rponline=substr($tmp_code,0,3); if($tmp_rponline=="rp-") { $message="Sorry, your code is reserverd."; $show_url=$tmp_url; } if(empty($message)) { $twiturl_status=twiturl_checkUrlIfExists($tmp_url); if($twiturl_status=="1") { $twiturl_code=twiturl_getCodeFromUrl($tmp_url); } if($twiturl_status=="2") { $twiturl_code=twiturl_createCodeForUrl($tmp_url,$tmp_code); } if($twiturl_code) { show_result($twiturl_code); exit; } if(!$twiturl_code) { $message="Your requested short URL is already in use. Please enter another one."; $show_url=$tmp_url; } } } ?>
twiturl is developed by Daniel Fiene and Malte Müller.