GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — php/db.php at main · linuxrun1/php Expand file tree/ Copy pathdb.phpMore file actions 53 lines (48 loc) · 1.65 KB / Copy pathdb.phpFile metadata and controls53 lines (48 loc) · 1.65 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 <?php date_default_timezone_set("Asia/Jakarta"); error_reporting(-1); ini_set('display_errors', 1); //MySQL Connection Database $conn = mysqli_connect($_SERVER['MYSQLHOST'].':'.$_SERVER['MYSQLPORT'],$_SERVER['MYSQLUSER'],$_SERVER['MYSQLPASSWORD'],$_SERVER['MYSQLDATABASE']) or die(mysqli_error()); $site = "https://url.vhost.my.id"; //Text Random function loh($n) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ($i = 0; $i < $n; $i++) { $index = rand(0, strlen($characters) - 1); $randomString .= $characters[$index]; } return $randomString; } //Script Rest Api Url Shortener Database if (@$_GET['key'] === 'fw'){ $a = loh(10); $longUrl = @$_POST['longUrl']; $shortUrl = $site.'/'.$a; if(!empty($longUrl)){ $sql = "INSERT INTO url (longUrl, shortUrl, code, view) VALUES('".$longUrl."','".$shortUrl."','".$a."','0')"; $simpan = mysqli_query($conn, $sql); if($simpan){ $arr = array( 'longUrl' => $longUrl, 'shortUrl' => $shortUrl, 'code' => $a, 'view' => '0' ); echo json_encode($arr, JSON_UNESCAPED_SLASHES); } } else { $arr = array( 'error' => 'failed', 'longUrl' => $longUrl, 'shortUrl' => $shortUrl, 'code' => $a, 'view' => '0' ); echo json_encode($arr, JSON_UNESCAPED_SLASHES); } }else{ echo "No auth key"; } ?> |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |