Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
102 lines (102 sloc) 3.38 KB
require_once 'config.php';
require_once 'includes.php';
<!DOCTYPE html>
<title> Orlando Web Design URL shortener</title>
<link type="text/css" rel="stylesheet" href="style.css" />
<link type="text/css" rel="stylesheet" media="only screen and (max-width: 480px)" href="mobile.css">
<meta name = "viewport" content = "width = device-width">
<div id="wrapper">
<a href="" title="Circle Tree Orlando Web Design Logo"><span id="logo"></span></a>
<?php if (AUTH) { ?>
<h1>PHP URL Shortener</h1>
<h2>Create New Short URL</h2>
<form method="post" action="shorten.php" id="shortener">
<label for="longurl">URL to shorten</label>
<input type="text" name="longurl" id="longurl" size="60" value="http://">
<input type="submit" value="Shorten">
<div class="error" style="display:none"></div>
<h2>Current Short URLS</h2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
$result = mysql_query('SELECT * FROM `shortenedurls` ORDER BY `created`');
while ($row = mysql_fetch_assoc($result)) {
echo '<tr >';
echo '<td align="left" style="border-bottom:1px solid #000;">';
echo ' <input onclick="$(this).select();" style="cursor:pointer;" type="text" size="30" name="short['.$row['id'].'" value="'.BASE_HREF.getShortenedURLFromID($row['id']).'"/>&rarr; ';
echo $row['long_url'];
echo '</td>';
echo '<td style="border-bottom:1px solid #000;">';
echo $row['referrals'];
echo '</td>';
echo '</tr>';
<script type="text/javascript" src=""></script>
<script type="text/javascript">
new function($) {
$.fn.setCursorPosition = function(pos) {
if ($(this).get(0).setSelectionRange) {
$(this).get(0).setSelectionRange(pos, pos);
} else if ($(this).get(0).createTextRange) {
var range = $(this).get(0).createTextRange();
range.moveEnd('character', pos);
range.moveStart('character', pos);;
$(function () {
$(window).bind('keyup', function (e) {
if (e.keyCode == 13) $("#shortener").trigger('submit');
var $longurl = $("#longurl");
$('#shortener').submit(function () {
data: {
longurl: $('#longurl').val()
url: 'shorten.php',
success: function (data,status) {
//createSelection(0,100, $("#longurl"));
error: function (XMLHttpRequest, textStatus) {
beforeSend: function () {
$longurl.removeClass('error success');
return false;
<?php } else { ?>
<h1>Orlando Web Design by Circle Tree</h1>
<a href="">Circle Tree WordPress Web Design in Orlando Florida</a>
<h2>Hello there!</h2>
This is our vanity URL shortening service. It's private - which is why you're seeing this</h2>
To learn more about <strong>vanity url shorteners</strong> and <strong>Orlando Web design</strong> <a href="" title="Contact Orlando Web Design Company Circle Tree">contact us</a>.
<?php }?>
Something went wrong with that request. Please try again.