Location: PHPKode > scripts > Free Url Shortener Script > sh/index.php
<!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" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>Free URL Shortener Script</title>
	<link rel="stylesheet" type="text/css" href="styles.css"/>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
	<script type="text/javascript">
		$(function()
		{
			$("#ajaxShorten").click(function() {
				
				$(this).hide();
				$("#load").show();
				$("#error").hide();
				
			 	$.post('ajax.php', {url : $("#longURL").val()}, function(data)
			 	{
			 		if(data.indexOf("http") == -1)
			 		{
			 			$("#error").show();
			 			$("#error").html(data);
			 		}else{
			 			$("#longURL").val(data);
			 		}
			 		$("#load").hide();
			 		$("#ajaxShorten").show();
			 	});
			});
		});
	</script>
</head>

<body>

<div id="main">
	<div id="shorten">
		<input type="text" id="longURL" value="http://long-and-ugly-url.com/" onclick="if(this.value=='http://long-and-ugly-url.com/') { this.value = '';}else{this.select();}"/>
		<br/><br/><br/>
		<a href="javascript:void(0);" id="ajaxShorten" style="text-decoration: none;border:0">
			<img src="btn.png" alt="shorten button" border="0" />
		</a>
		<img src="ajax-loader.gif" id="load" style="display: none;" alt=""/>
	</div>
	
	<div style="display: none;position:relative;margin:0 auto; background-color:#cc0000;color:white;padding:10px;width:500px;font-size:18px;" id="error"></div>
	
</div>

</body>
</html>
Return current item: Free Url Shortener Script