- 掃描 ID:
- e1f89bad-6fb8-4bcf-acdc-ca7537b39fa5已完成
- 已提交的 URL:
- https://t.co/yrWuwyxggB
- 報告完成時間:
連結 · 找到 0 個
從頁面中識別的傳出連結
JavaScript 變數 · 找到 8 個
在頁面的視窗物件上載入的全域 JavaScript 變數是在函數外部宣告的變數,可從目前範圍內程式碼中的任何位置存取
名稱 | 類型 |
---|---|
onbeforetoggle | object |
documentPictureInPicture | object |
onscrollend | object |
isValidInput | function |
generateCaptcha | function |
setCaptcha | function |
validateCaptcha | function |
register | function |
主控台記錄訊息 · 找到 4 條
記錄到 Web 主控台的訊息
類型 | 類別 | 記錄 |
---|---|---|
log | other |
|
verbose | dom |
|
verbose | dom |
|
log | other |
|
HTML
頁面的原始 HTML 主體
<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paradise</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #121212;
color: #e0e0e0;
margin: 0;
}
.container {
background-color: #1e1e1e;
padding: 40px;
border-radius: 12px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
width: 90%;
max-width: 400px;
transition: transform 0.3s ease-in-out;
}
.container:hover {
transform: scale(1.02);
}
.form-group {
width: 100%;
margin-bottom: 20px;
}
.form-group h2 {
margin-bottom: 20px;
color: #ffffff;
text-align: center;
font-size: 24px;
}
.form-group label {
display: block;
margin-bottom: 8px;
color: #ffffff;
font-size: 14px;
}
.form-group input {
width: calc(100% - 24px);
padding: 12px;
margin-bottom: 10px;
border: none;
border-radius: 6px;
background-color: #2c2c2c;
color: #e0e0e0;
font-size: 16px;
transition: background-color 0.3s ease-in-out;
}
.form-group input:focus {
outline: none;
background-color: #3c3c3c;
}
.form-group button {
width: calc(100% - 24px);
display: block;
padding: 12px;
border: none;
border-radius: 6px;
background-color: #ffffff;
color: #121212;
font-weight: bold;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease-in-out;
margin: 0 auto;
}
.form-group button:hover {
background-color: #c4c4c4;
}
.toggle-link {
display: block;
margin-top: 10px;
color: #ffffff;
cursor: pointer;
text-align: center;
font-size: 14px;
transition: color 0.3s ease-in-out;
}
.toggle-link:hover {
color: #949494;
}
</style>
</head>
<body>
<div class="container">
<div id="register-form" class="form-group" data-captcha-answer="17">
<h2>Register</h2>
<label for="register-username">Username</label>
<input type="text" id="register-username" name="username" required="">
<label for="register-password">Password</label>
<input type="password" id="register-password" name="password" required="">
<label for="register-repeat-password">Repeat Password</label>
<input type="password" id="register-repeat-password" name="repeat-password" required="">
<label for="register-captcha">What is <span id="register-captcha-question">8 + 9</span>?</label>
<input type="text" id="register-captcha" name="captcha" required="">
<button type="button" onclick="register()">Register</button>
<span class="toggle-link" onclick="window.location.href='/login'">Already have an account? Login</span>
</div>
</div>
<script>
function isValidInput(input) {
const regex = /^[a-zA-Z0-9_ ]{5,15}$/;
return regex.test(input);
}
function generateCaptcha() {
const num1 = Math.floor(Math.random() * 10);
const num2 = Math.floor(Math.random() * 10);
return { question: `${num1} + ${num2}`, answer: num1 + num2 };
}
function setCaptcha(formId, questionId) {
const captcha = generateCaptcha();
document.getElementById(questionId).innerText = captcha.question;
document.getElementById(formId).dataset.captchaAnswer = captcha.answer;
}
function validateCaptcha(formId, inputId) {
const form = document.getElementById(formId);
const userAnswer = document.getElementById(inputId).value;
return parseInt(userAnswer) === parseInt(form.dataset.captchaAnswer);
}
function register() {
const username = document.getElementById('register-username').value;
const password = document.getElementById('register-password').value;
const repeatPassword = document.getElementById('register-repeat-password').value;
const captchaValid = validateCaptcha('register-form', 'register-captcha');
const referralCode = sessionStorage.getItem('referralCode') || '';
if (!username || !password || !repeatPassword || !captchaValid) {
alert('Please fill in all fields and answer the captcha correctly.');
return;
}
if (password !== repeatPassword) {
alert('Passwords do not match.');
return;
}
if (!isValidInput(username) || !isValidInput(password)) {
alert('Username and password must be 5-15 letters or numbers.');
return;
}
fetch('/register', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `username=${username}&password=${password}&referralCode=${referralCode}`
})
.then(response => {
if (response.redirected) {
window.location.href = response.url; // Redirect to the appropriate page
} else {
return response.text();
}
})
.then(data => {
if (data === 'Username already taken.') {
alert('Username already taken. Please choose another one.');
} else if (data && data !== 'User registered successfully') {
alert('Registration failed. Please try again.');
} else {
window.location.href = '/dashboard'; // Redirect to dashboard after successful registration
}
});
}
document.addEventListener('DOMContentLoaded', () => {
setCaptcha('register-form', 'register-captcha-question');
// Capture referral code from the URL
const urlParams = new URLSearchParams(window.location.search);
const referralCode = urlParams.get('referralCode') || window.location.pathname.split('/').pop();
if (referralCode) {
console.log('Referral code from URL:', referralCode);
sessionStorage.setItem('referralCode', referralCode);
}
// Check if there is a referral code in the session
fetch('/getReferralCodeFromSession')
.then(response => response.json())
.then(data => {
if (data.referralCode) {
console.log('Referral code from session:', data.referralCode);
sessionStorage.setItem('referralCode', data.referralCode);
}
})
.catch(err => {
console.error('Failed to fetch referral code from session:', err);
});
});
</script>
</body></html>