2012-10-09 07:02:44 +00:00
|
|
|
<title>URL Shortner</title>
|
|
|
|
<script language="javascript" type="text/javascript">
|
|
|
|
function showHide(shID) {
|
|
|
|
if (document.getElementById(shID)) {
|
|
|
|
if (document.getElementById(shID+'-show').style.display != 'none') {
|
|
|
|
document.getElementById(shID+'-show').style.display = 'none';
|
|
|
|
document.getElementById(shID).style.display = 'block';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
document.getElementById(shID+'-show').style.display = 'inline';
|
|
|
|
document.getElementById(shID).style.display = 'none';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
|
|
.api {
|
|
|
|
display: none;
|
|
|
|
border-top: 1px solid #666;
|
|
|
|
border-bottom: 1px solid #666; }
|
|
|
|
a.showApi, a.hideApi {
|
|
|
|
text-decoration: none;
|
|
|
|
color: #36f;
|
|
|
|
padding-left: 8px; }
|
|
|
|
a.showApi:hover, a.hideApi:hover {
|
|
|
|
border-bottom: 1px dotted #36f; }
|
|
|
|
</style>
|
2012-10-07 23:52:44 +00:00
|
|
|
<body bgcolor="black" text="greem"><div align="center">
|
|
|
|
<img src="http://unps-gama.tk/upload/Pictures/header.png"><br>
|
2012-10-09 07:02:44 +00:00
|
|
|
<h4>Welcome to the UnPS-GAMA page shortner</h4>
|
|
|
|
<a href="#" id="api-show" class="showApi" onclick="showHide('api');return false;">Existing Short Links</a>
|
|
|
|
<div id="api" class="api">
|
2012-10-08 01:01:39 +00:00
|
|
|
<?php
|
|
|
|
include('getfiles.php');
|
2012-10-09 07:02:44 +00:00
|
|
|
echo "<table><tr><td><div align'center'><P>List of links already:</p></div></td></tr><tr><td>" . $thelist . "</td></tr></table>";
|
2012-10-08 01:01:39 +00:00
|
|
|
?>
|
2012-10-09 07:02:44 +00:00
|
|
|
<a href="#" id="api-hide" class="hideApi" onclick="showHide('api');return false;">Close Me</a>
|
|
|
|
</div>
|
2012-10-08 01:01:39 +00:00
|
|
|
<br><hr><br>
|
2012-10-07 23:52:44 +00:00
|
|
|
<?php
|
|
|
|
include("config.php");
|
|
|
|
if(!$_POST['submit'])
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<form action="index.php" method="POST">
|
|
|
|
<p>Destination:<br><input name="dest" type="text" size="30" ></p>
|
|
|
|
<input type="submit" name="submit" value="submit">
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
$dest=$_POST['dest'];
|
|
|
|
if($_POST["submit"])
|
|
|
|
{
|
2012-10-08 03:01:01 +00:00
|
|
|
if(isset($_POST['dest']) && $dest != "")
|
2012-10-07 23:52:44 +00:00
|
|
|
{
|
2012-10-10 02:03:32 +00:00
|
|
|
$myFile = $random.".php";
|
2012-10-07 23:52:44 +00:00
|
|
|
$fh = fopen($myFile, 'w') or die("can't open file");
|
|
|
|
$stringData = '
|
|
|
|
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
<html>
|
2012-10-10 02:03:32 +00:00
|
|
|
<head><title>'.$random.'</title>
|
|
|
|
<?php
|
|
|
|
$currentFile = $_SERVER["PHP_SELF"];
|
|
|
|
$parts = Explode(\'/\', $currentFile);
|
2012-10-07 23:52:44 +00:00
|
|
|
|
2012-10-10 02:03:32 +00:00
|
|
|
$myFile = "log/".$parts[count($parts) - 1].".log";
|
|
|
|
$fh = fopen($myFile, \'a\') or die("can\'t open file");
|
2012-10-10 02:32:17 +00:00
|
|
|
$string = $_SERVER[\'REMOTE_ADDR\']."\n";
|
2012-10-10 02:03:32 +00:00
|
|
|
fwrite($fh, $string);
|
|
|
|
fclose($fh);
|
|
|
|
?>
|
2012-10-07 23:52:44 +00:00
|
|
|
<meta http-equiv="REFRESH" content="0;url='.$dest.'"></HEAD>
|
|
|
|
<BODY>
|
|
|
|
Service by '.$pagepath.'
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|
|
|
|
';
|
|
|
|
fwrite($fh, $stringData);
|
|
|
|
fclose($fh);
|
|
|
|
echo '
|
|
|
|
Thanks for using '.$pagetitle.' <br>
|
2012-10-08 03:09:24 +00:00
|
|
|
your link is available here (right click, copy link):<br>
|
2012-10-09 00:43:47 +00:00
|
|
|
<a href='.$pagepath.$random.' target='.$random.'>'.$pagepath.$random.'</a><br>
|
2012-10-07 23:52:44 +00:00
|
|
|
<a href="index.php">Back to index</a><br>
|
|
|
|
<a href="http://unps-gama.tk">Home</a>
|
|
|
|
|
|
|
|
';
|
2012-10-08 03:01:01 +00:00
|
|
|
}if($dest == ""){
|
|
|
|
echo '
|
|
|
|
Sorry, you are not able to shorten something without a url <br>
|
|
|
|
<a href="index.php">Back to index</a><br>
|
|
|
|
<a href="http://unps-gama.tk">Home</a>
|
|
|
|
|
|
|
|
';
|
|
|
|
|
|
|
|
}
|
2012-10-07 23:52:44 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
?>
|