WEBLEB
Home
Editor
Login
Pro
English
English
Français
Español
Português
Deutsch
Italiano
हिंदी
testings
58
rajflores712
Open In Editor
Publish Your Code
HTML
Copy
prepare("SELECT id FROM users WHERE username = ? OR email = ?"); $checkStmt->bind_param("ss", $username, $email); $checkStmt->execute(); $checkStmt->store_result(); if ($checkStmt->num_rows > 0) { $errors[] = "Username or email already exists."; } else { // Insert new user $hashed_password = password_hash($password, PASSWORD_DEFAULT); $insertStmt = $conn->prepare("INSERT INTO users (username, email, password) VALUES (?, ?, ?)"); $insertStmt->bind_param("sss", $username, $email, $hashed_password); if ($insertStmt->execute()) { session_regenerate_id(true); $_SESSION['success'] = "Registration successful. Please login."; header("Location: login.php"); exit(); } else { $errors[] = "An unexpected error occurred. Please try again."; } $insertStmt->close(); } $checkStmt->close(); } } ?>
User Registration
User Registration
= htmlspecialchars($error, ENT_QUOTES, 'UTF-8') ?>
Username: 0/8–16
Register
Already have an account?
Login here
.
CSS
Copy
/* ============================ Reset and Base Styles ============================ */ * { margin: 0; padding: 0; box-sizing: border-box; } html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: Arial, sans-serif; background-color: #1a1a1a; color: #fff; } /* ============================ Network Canvas Background ============================ */ #network-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; } /* ============================ Form Container ============================ */ .form-container { position: relative; background: rgba(37, 35, 35, 0.623); padding: 30px; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); width: 350px; text-align: center; backdrop-filter: blur(10px); transition: transform 0.4s ease, background 0.3s ease; border: 1px solid rgba(255, 255, 255, 0.2); z-index: 1; margin: auto; top: 50%; transform: translateY(-50%); } .form-container:hover { transform: translateY(-50%) scale(1.03); background: rgba(3, 3, 3, 0.2); } .form-container h2 { margin-bottom: 20px; font-weight: bold; } /* ============================ Input Group (with Icons) ============================ */ .input-group { position: relative; margin-bottom: 15px; width: 100%; } .input-group i { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: rgba(255, 255, 255, 0.85); font-size: 16px; pointer-events: none; z-index: 1; } .input-group input { width: 100%; padding: 12px 12px 12px 40px; /* Space for icon */ border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; background: rgba(255, 255, 255, 0.15); color: white; font-size: 14px; outline: none; transition: all 0.3s ease; } .input-group input::placeholder { color: rgba(255, 255, 255, 0.7); } .input-group input:focus { border-color: #3498db; background: rgba(255, 255, 255, 0.25); } /* ============================ Buttons ============================ */ button { width: 100%; padding: 12px; background: #3498db; color: #fff; font-weight: bold; border: none; border-radius: 6px; cursor: pointer; transition: background 0.3s, transform 0.2s; } button:hover { background: #2980b9; transform: scale(1.05); } /* ============================ Error and Success Messages ============================ */ .error-box, .success-box { padding: 12px; margin-bottom: 10px; border-radius: 6px; font-weight: bold; text-align: center; } .error-box { background: rgba(231, 76, 60, 0.85); color: #fff; } .success-box { background: rgba(46, 204, 113, 0.85); color: #fff; } /* ============================ Links ============================ */ p { margin-top: 15px; font-size: 14px; } a { color: #3498db; text-decoration: none; font-weight: bold; transition: color 0.3s; } a:hover { text-decoration: underline; color: #2980b9; } /* ============================ Responsive Design ============================ */ @media (max-width: 400px) { .form-container { width: 90%; padding: 20px; } }
JS
Copy
const canvas = document.getElementById('network-canvas'); const ctx = canvas.getContext('2d'); canvas.width = window.innerWidth; canvas.height = window.innerHeight; const nodes = []; const maxNodes = 100; const maxDistance = 100; class Node { constructor(x, y) { this.x = x; this.y = y; this.vx = (Math.random() - 0.5) * 2; this.vy = (Math.random() - 0.5) * 2; } update() { this.x += this.vx; this.y += this.vy; if (this.x < 0 || this.x > canvas.width) this.vx *= -1; if (this.y < 0 || this.y > canvas.height) this.vy *= -1; } draw() { ctx.beginPath(); ctx.arc(this.x, this.y, 2, 0, Math.PI * 2); ctx.fillStyle = '#00ffcc'; ctx.fill(); } } for (let i = 0; i < maxNodes; i++) { nodes.push(new Node(Math.random() * canvas.width, Math.random() * canvas.height)); } function drawConnections() { for (let i = 0; i < nodes.length; i++) { for (let j = i + 1; j < nodes.length; j++) { const dx = nodes[i].x - nodes[j].x; const dy = nodes[i].y - nodes[j].y; const distance = Math.sqrt(dx * dx + dy * dy); if (distance < maxDistance) { ctx.beginPath(); ctx.moveTo(nodes[i].x, nodes[i].y); ctx.lineTo(nodes[j].x, nodes[j].y); ctx.strokeStyle = `rgba(0, 255, 204, ${1 - distance / maxDistance})`; ctx.stroke(); } } } } function animate() { ctx.clearRect(0, 0, canvas.width, canvas.height); for (const node of nodes) { node.update(); node.draw(); } drawConnections(); requestAnimationFrame(animate); } animate(); window.addEventListener('resize', () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; });