PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL UNIQUE, email VARCHAR(100) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, role ENUM('admin', 'user') NOT NULL, otp VARCHAR(6) DEFAULT NULL, is_verified BOOLEAN DEFAULT FALSE, failed_attempts INT DEFAULT 0, lockout_time INT DEFAULT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); INSERT INTO users (username, email, password, role, is_verified) VALUES ('admin', 'admin@example.com', '$2y$10$examplehashpassword1', 'admin', TRUE), ('user1', 'user1@example.com', '$2y$10$examplehashpassword2', 'user', TRUE), ('user2', 'user2@example.com', '$2y$10$examplehashpassword3', 'user', TRUE); CREATE TABLE user_verifications ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, otp VARCHAR(6) NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ); CREATE TABLE sessions ( id VARCHAR(128) NOT NULL PRIMARY KEY, data TEXT NOT NULL, timestamp INT(11) UNSIGNED NOT NULL );
Copy Clear
Copy Format Clear
<?php // Check if the user is logged in, if not then redirect to login page if (!isset($_SESSION['username'])) { header("Location: index.php"); exit(); } ?> <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="../style2.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" /> <script type="module" defer src="../public/index.js"></script> <script src="https://kit.fontawesome.com/3f986c7e46.js" crossorigin="anonymous"></script> <link rel="icon" href="../media/logo.png"> <title>PixlHunt</title> </head> <body> <nav class="navbar"> <div class="navbar-one"> <a href="homepage.php"> <img src="../media/logo.png" id="logo-nav" alt="PixlHunt Logo"> PixlHunt </a> </div> <div> <a href="homepage.php" class="right">Home</a> <a href="./category.html" class="right">Category</a> <a href="./aboutUs.html" class="right">About Us</a> <a href="./contactUs.html" class="right">Contact Us</a> <a href="../logout.php" class="right">Logout</a> </div> </nav> <main class="main-content"> <section class="content-desc-index"> <div class="content-header"> <h3>Welcome To</h3> <h1>PixlHunt</h1> </div> </section> <section class="content-details-index"> <div class="column1"> <div class="column1-text"> <h3>Food</h3><br> <p>Want to explore some cafes in KL? The capital of Malaysia, Kuala Lumpur, has seen a significant increase in the cafe scene. These cafés in Kuala Lumpur serve high-quality drinks, such as some unique tea and coffee variations, but the majority of them are well-known for their lavish brunches and delicious desserts since most of them double as cafes and bakeries. In the centre of Kuala Lumpur City, you can be guaranteed to discover the greatest and newest cafes. To satisfy the coffee enthusiast in you, go ahead and select the best of the bunch.</p><br> <p>Contact Us | +60 1234 56789</p> </div> </div> <div class="column2"> <div class="column2-text"> <h3>Art Gallery</h3><br> <p>A life well lived is one spent seeing the world's art museums and galleries. This is true everywhere on Earth, including Kuala Lumpur, and visiting these galleries will inspire you with inspiration and excitement in equal measure. There is a lot of studies to suggest that the reputation of the so-called Garden City of Lights as a creative and artistic hub has plenty of fuel left in the tank.</p><br> <p>Contact Us | +60 1234 56789</p> </div> </div> <div class="column3"> <div class="column3-text"> <h3>Attraction</h3><br> <p>The Petronas Twin Towers, which are the tallest twin structures in the world, are located in Kuala Lumpur, the capital and largest city of Malaysia. Kuala Lumpur is renowned for being a retail haven. This metropolis, also referred to as KL, is the entry point to the rest of Malaysia. It is rich in countless natural beauties and architectural icons, as well as numerous locations where tourists of all types can enjoy traditional Malay food.</p><br> <p>Contact Us | +60 1234 56789</p> </div> </div> </section> <section class="content-slideshow"> <h2>MOST VIEWED</h2> <div class="homepage-images"> <p>Are you curious to see which one category's places is the most viewed? Here are the most viewed places from each category!</p> <div class="homepage-images-first"> <img src="../media/back.png" class="arrow" id="prevHomeButton"> <div class="image-holders-first-homepage"> <img src="../media/review2.jpg" id="homepage-images-first-slide"> <img src="../media2/ilhamGallery/ReviewIg1.png" style="display: none;"> <img src="../imagesSunway/sunway1.jpg" style="display: none;"> </div> <img src="../media/next.png" class="arrow" id="nextHomeButton"> </div> </div> </section> </main> <footer> <div class="footer-info"> <h2>Information</h2> <div class="footer-info-a"> <h3> <a href="./category.html">Category</a> </h3> <h3> <a href="./aboutUs.html">About Us</a> </h3> <h3> <a href="./contactUs.html">Contact Us</h3> </div> </div> <div class="separator"></div> <div class="footer-socials"> <div class="footer-socials-media"> <a href="https://www.instagram.com/pixlhunt/" target="_blank"> <img src="../media/instagram.png" alt="Instagram"> </a> <h2>Social Media</h2> </div> <div class="socials-media-insta"> <a href="https://www.instagram.com/pixlhunt/" target="_blank"> <img src="../media/insta1.jpg" alt="Instagram Photo"> <img src="../media/insta2.jpg" alt="Instagram Photo"> </a> </div> <div class="socials-media-insta-second"> <a href="https://www.instagram.com/pixlhunt/" target="_blank"> <img src="../media/review1.jpg" alt="Instagram Photo"> <img src="../media/review2.jpg" alt="Instagram Photo"> </a> </div> </div> <div class="separator"></div> <div class="footer-contact"> <h2>Contact Information</h2> <div class="footer-contact-email"> <img src="../media/mail.png" alt="Gmail"> <h3>pixlHunt.pixl@gmail.com</h3> </div> <div class="footer-contact-phone"> <img src="../media/phone-call.png" alt="Phone Number"> <h3>+60 1234 56789</h3> </div> </div> </footer> </body> </html>
Show:  
Copy Clear