diff options
Diffstat (limited to 'www/puush.php')
| -rw-r--r-- | www/puush.php | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/www/puush.php b/www/puush.php index 58b4ee6..5757360 100644 --- a/www/puush.php +++ b/www/puush.php @@ -1,3 +1,6 @@ +<?php +include("include.php"); +?> <!Doctype html> <head> <title>Random Youtube Video</title> @@ -8,47 +11,17 @@ <body vlnk='#5b5b5b' vlink='#000000' link='#000000' alink='#9a9696'> <center> <?php - include("header.php"); include("piwik.php"); ?> <h1>A random "puu.sh" file!</h1> <br> -<? -$count = 0; - -function get_image($count){ - - $puush_array = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", - "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", - "5", "6", "7", "8", "9" ); - $length = count($puush_array); - - $id = ""; - $string = ""; - - for ($i=0;$i<4;$i++){ - $index = mt_rand(0,$length-1); - $id = "$id".$puush_array[$index]; - } +<?php +$count = 0; +$count = 0; - if(fopen("https://puu.sh/" . $id, "r")){ - echo "<a href='https://puu.sh/" . $id . "'><img src='https://puu.sh/" .$id . "' alt='" . $id ."' ></a>"; - return $count; - } else { - $count = $count + 1; - if($count < 100){ - $count = get_image($count); - } else { - echo "We tried for " . $count . " times. Now is enough. <br><br>"; - echo "<a href='/puush'>Try again</a>"; - exit; - } - } - return $count; -} +$count = get_image($count); $count = get_image($count); |
