Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031// Check for php server availabilityasync function checkPhpServer(username, password) { try { const response = await fetch('/app/server.check.php'); if (!response.ok) throw new Error('No PHP server'); const text = await response.text(); if (text.trim() !== 'PHP_OK') throw new Error('PHP check failed');
return true; } catch (error) { alert(`Sorry there is no PHP server running right now, here are your credentials btw:\nUsername: ${username}\nPassword: ${password}`); location.reload(); return false; }}
// Clear all inputs in the form when submittedconst form = document.querySelector("form");
form.addEventListener('submit', async (event) => { event.preventDefault();
const username = form.elements['username'].value; const password = form.elements['password'].value;
const phpIsRunning = await checkPhpServer(username, password); if (!phpIsRunning) return;
form.submit();});