Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. <title>Kevin Andrews / TXT</title>
  2. <?php
  3. $displayform = 'display';
  4.  
  5. if ($_GET['form'] == $displayform)
  6. {
  7. echo '<form method="get" action="">
  8. <input type="hidden" name="form" value="display">
  9. <input name="url" placeholder="Enter the long link (http://...)" size="50" <="" input=""><br>
  10. <input type="password" name="password" placeholder="Password" size="17" maxlength="15"><br>
  11. <input type="submit" value="Create"> or <input type="submit" href="" value="Refresh">
  12. </form>
  13. <hr>';
  14. } else {
  15. echo "";
  16. }
  17.  
  18. $shortenedlink = mt_rand(10000, 99999);
  19. $password = 'quieroentrar123';
  20. $longlink = $_GET['url'];
  21. if (!isset($longlink) || trim($longlink) == '') {
  22. echo "The long link is empty.";
  23. exit;
  24. }
  25.  
  26. $notallowed = array("<",">");
  27. $longlink = str_replace($notallowed,"", $longlink);
  28.  
  29. if ($_GET['password'] == $password)
  30. {
  31. echo "";
  32. } else {
  33. echo "The password is not valid.";
  34. exit;
  35. }
  36.  
  37. $shortenedlinkpath = "../$shortenedlink.asp";
  38. if (file_exists($shortenedlinkpath)) {
  39. echo "The assigned number already exists, please try again.";
  40. exit;
  41. } else {
  42. echo "";
  43. }
  44.  
  45. $shortenedfilecontent = '<title>Outgoing to #'.$shortenedlink.'</title>
  46. <script type="text/javascript" language="javascript">
  47.  
  48. window.addEventListener("load", function() {
  49. setTimeout(func1, 10000);
  50. });
  51.  
  52. function func1() {
  53. document.getElementById("div1").className = "show";
  54. }
  55.  
  56. window.addEventListener("load", function() {
  57. setTimeout(func2, 10000);
  58. });
  59.  
  60. function func2() {
  61. document.getElementById("div2").className = "hide";
  62. }
  63.  
  64. </script>
  65. <script type="text/javascript" language="javascript">
  66. // Internet Explorer
  67. window.onload = function()
  68. {
  69. document.onselectstart = function()
  70. {
  71. return false;
  72. }
  73. // Firefox
  74. document.onmousedown = function()
  75. {
  76. return false;
  77. }
  78. }
  79.  
  80. </script>
  81. <style type="text/css">
  82.  
  83. .hide{
  84. display:none;
  85. }
  86.  
  87. .show{
  88. display:block;
  89. }
  90.  
  91. </style><p>An anonymous user has used this service to create a shortened URL with a redirect to an external page. For your security, the page to which you will be redirected in 30 seconds is:<form action="" method="post"><input type="text" size="50" placeholder="'.$longlink.'" readonly onmousedown="return false;" /></form><img style="border:5px double black;" alt="It seems that the screenshot of the site can not be seen. Reload the page or re-create the shortened link." src="https://auth.kenygamer.com/api/image?width=340&height=200&screen=1024&url='.$longlink.'"><br><br>If this URL is not what you were looking for or it may not be according to your criteria, please leave this page immediately to avoid being redirected, otherwise ignore this warning and touch the button that will appear below this text 10 seconds after the page was loaded.<div id="div1" class="hide"><form action="'.$longlink.'" method=""><center><input type="submit" value="Redirect"></center></form></div><br><hr>The URL you are viewing has been shortened for free. Shorten yours at http://auth.kenygamer.com and provide security to your visitors by giving them the link (not selectable) and a screenshot of the site they are going to. If you think I'm doing well, consider donating.</p><meta http-equiv="refresh" content="30; url='.$longlink.'">';
  92. $fp = fopen("../$shortenedlink.asp", "w");
  93. fwrite($fp, $shortenedfilecontent) . '&nbsp;';
  94. fclose($fp);
  95.  
  96. $line = date('Y-m-d H:i:s') . " - $longlink - #$shortenedlink - $_SERVER[REMOTE_ADDR] n";
  97. $fplog = fopen("../logs/d41d8cd98f00b204e9800998ecf8427e-create.txt", "a+");
  98. fwrite($fplog, $line) . '&nbsp;';
  99. fclose($fplog);
  100. echo ("The shortened URL has been successfully created. The shortened number #$shortenedlink has been assigned to your long URL $longlink.");
  101. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement