" . curPageURL() . ""; function curPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); } $rootPath = $_SERVER['DOCUMENT_ROOT']; $thisPath = dirname($_SERVER['PHP_SELF']); $onlyPath = str_replace($rootPath, '', $thisPath); $pathname = $onlyPath . "/" . curPageName(); echo "
"; echo $pathname; // Page Path Name Script End $servername = "localhost"; $username = "landscap_lol"; $password = "meow2meow"; $dbname = "landscap_lollive"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // start for the banner add counting and getting from table $sql = "SELECT * FROM banner_ups where page =" . $pathname . " AND picture IS NOT NULL ORDER BY RAND()"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row echo "
"; echo ""; while($row = $result->fetch_assoc()) { echo ""; } } echo "
"; echo "
"; $conn->close(); // Banner Ads end ?>
Advertisement