Posts

Showing posts from June, 2025

Dom navigation

  students.xml <?xml version="1.0"?> <students>   <student>     <name>Aditya Vhanugare</name>     <rollno>CE201234</rollno>     <branch>Computer Engineering</branch>   </student>   <student>     <name>Priya Sharma</name>     <rollno>CE201235</rollno>     <branch>Information Technology</branch>   </student> </students> Python.py from xml.dom.minidom import parse # Parse the XML file dom_tree = parse("students.xml") students = dom_tree.documentElement # Get all <student> elements student_list = students.getElementsByTagName("student") # Simple for loop to retrieve student data for student in student_list:     name = student.getElementsByTagName("name")[0].firstChild.data     rollno = student.getElementsByTagName("rollno")[0].firstChild.data     branch = stud...

Upload file

  fileloader.html <!DOCTYPE html> <html> <head>     <title>File Upload</title> </head> <body>     <h2>Upload Image File (GIF, JPEG, PJPEG, < 20KB)</h2>     <form action="upload_file.php" method="post" enctype="multipart/form-data">         <input type="file" name="image">         <br><br>         <input type="submit" name="submit" value="Upload">     </form> </body> </html> upload_file.php <?php if (isset($_POST['submit'])) {     $file = $_FILES['image'];     // Get file properties     $fileName = $file['name'];     $fileTmp = $file['tmp_name'];     $fileSize = $file['size'];     $fileType = $file['type'];     // Allowed MIME types     $allowedTypes = ['image/gif', 'image/jpeg', 'image/pjpeg']; ...

Session

login.php  <!DOCTYPE html> <html> <head>     <title>Login</title> </head> <body>     <h2>Login Form</h2>     <form method="POST" action="login_process.php">         Username: <input type="text" name="username" required><br><br>         Password: <input type="password" name="password" required><br><br>         <input type="submit" value="Login">     </form> </body> </html> Login_process.php <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; // Simple check: username must equal password if ($username === $password) {     $_SESSION['user'] = $username;     header("Location: secured.php"); } else {     header("Location: login.php"); } exit(); ?> Secured.php <?php session_start(); if (!isset($_SES...

Student registration

CREATE DATABASE student_db; USE student_db; CREATE TABLE users (     id INT AUTO_INCREMENT PRIMARY KEY,     username VARCHAR(50) UNIQUE,     password VARCHAR(255) ); CREATE TABLE exam_registration (     id INT AUTO_INCREMENT PRIMARY KEY,     name VARCHAR(100),     roll VARCHAR(20),     email VARCHAR(100),     course VARCHAR(50) ); -- Insert test user INSERT INTO users (username, password) VALUES ('testuser', MD5('test123')); index.php <?php session_start(); $host = "localhost"; $username = "root"; $password = ""; $database = "student_db"; $conn = new mysqli($host, $username, $password, $database); if ($conn->connect_error) die("Connection failed: " . $conn->connect_error); // Handle Login if (isset($_POST['login'])) {     $user = $_POST['username'];     $pass = md5($_POST['password']); // simple hash     $result = $conn->query("SELECT * FROM users WHERE username='$us...

Race

 <!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8">   <title>Racing Objects Animation</title>   <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>   <style>     body {       font-family: Arial, sans-serif;       text-align: center;       background-color: #f0f0f0;       padding-top: 50px;     }     .race-track {       position: relative;       width: 100%;       max-width: 800px;       height: 150px;       margin: 20px auto;       background-color: #ddd;       border: 2px solid #555;     }     .car {       position: absolute;       top: 20px;       left: 0;       width: 50px;       height: 50px...

Cricket

 <!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8">   <title>Simple Cricket Scoreboard</title>   <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>   <style>     body { font-family: sans-serif; text-align: center; margin-top: 50px; }     .score { font-size: 24px; margin-bottom: 20px; }     button { margin: 5px; padding: 10px 20px; font-size: 16px; }     .message { color: green; margin-top: 10px; height: 20px; }   </style> </head> <body>   <h2>Cricket Scoreboard</h2>   <div class="score">     Runs: <span id="runs">0</span> |     Wickets: <span id="wickets">0</span> |     Overs: <span id="overs">0.0</span>   </div>   <button class="run" data-run="1">+1 Run</button>   <button class="run" data...

Link 🌚

 https://limewire.com/d/ySZhL#mVg16Oqwzv