Code: Select all
<html>
<head>
<Title>Wiurl - Make any url a wi one</title>
<style type="text/css">
<!--
.style1 {font-size: medium}
.style2 {font-size: large}
-->
</style>
</head>
<body>
<table width="315" border="0" align="center">
<tr>
<td width="582">
<?php
$domain = $_SERVER['HTTP_HOST'];
$path = $_SERVER['SCRIPT_NAME'];
$queryString = $_SERVER['QUERY_STRING'];
$url = "http://" . $domain . $path . "?" . $queryString;
$url2 = "http://" . $domain . $_SERVER['REQUEST_URI'];
?>
<h2><span class="style2">Please enter a URL Below</span></h2>
<form method="post">
Your Long URL: <input name="oldurl" type="text" value="http://" size="25">
<br>
New wi URL: wiurl.com/l/
<input type="text" name="newurl"><br>
<input type="submit" name="submit" value="Shorten">
</form>
<?php
srand ((double) microtime( )*1000000);
$random_number = rand(0,150);
if ($_POST['submit']) {
$newurl = $_POST['newurl'];
$oldurl = $_POST['oldurl'];
$title= $_POST['title'];
$urlcloking= $_POST['urlcloking'];
$redirect = "<html><head><title>$title</title></head><body>
<iframe src='$oldurl' height='100%' width='100%' frameborder='0'>
</body></html>";
if(file_exists("l/$newurl/")) die("Sorry, there is already a URL with that name.");
mkdir("l/$newurl");
if ($urlcloking=="yes") {
$filename = "l/$newurl/index";
$filename .= ".php";
$Content = "<html><head><title>$title</title></head><body>
$redirect
</body></html>";
$handle = fopen($filename, 'x+');
fwrite($handle, $Content);
fclose($handle);
?>Yourr new URL is <a href=http://wiurl.com/l/<?php echo "$newurl"; ?>>http://wiurl.com/l/<?php echo"$newurl"; ?></a>
<?php
die();
}
$filename = "l/$newurl/index";
$filename .= ".php";
$Content = "<META http-equiv='refresh' content='0;URL=$oldurl'>";
$handle = fopen($filename, 'x+');
fwrite($handle, $Content);
fclose($handle);
?>
<br>
<h2 class="style1">Success!</h2>
Your new URL is <a href=http://wiurl.com/l/<?php echo "$newurl"; ?>>http://wiurl.com/l/<?php echo"$newurl"; ?></a>
<?php
}
//THIS MUST STAY INTACT!
echo $copyright;
?></td>
</tr>
</table>
<div align="center"></div>
<div align="center"></div>