diff --git a/img/index.php b/img/index.php index 235569f..4872460 100755 --- a/img/index.php +++ b/img/index.php @@ -52,7 +52,25 @@ $username = ''; $tags = ''; $_SESSION['noimg'] = ''; - + + function showads(){ + // Code for ads or something... + $db = new mysqli('localhost', 'adds', 'password', 'adds'); // hostname. username, password, database + if($db->connect_errno > 0){ + die('Unable to connect to database [' . $db->connect_error . ']'); + } + + $rand = mt_rand(1, 6); + $ads = "SELECT * FROM `ads` WHERE `id` = $rand"; + + if(!$result = $db->query($ads)){ + die('There was an error running the query [' . $db->error . ']'); + } + $row = $result->fetch_assoc(); + if($row){ + return 'ad for '.$row['cname'].''; + } + } ?> @@ -152,7 +170,9 @@
- This is a placeholder for ads +