My Buttons Work When Running The Script By Showing Their Respective Forms But When I Run It On A Local Server I Get A 404 Not Found When Clicked

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>function openCreateAccountForm() {
// Dimensions for the popup window
const width = 500;
const height = 500;
// Calculate the position to center the popup
const left = (window.innerWidth / 2) - (width / 2);
const top = (window.innerHeight / 2) - (height / 2);
// Open the popup window with the calculated position
window.open('../Forms/createAccount.html', 'popup', `width=${width},height=${height},top=${top},left=${left}`);
}
function openSignInForm() {
// Dimensions for the popup window
const width = 500;
const height = 500;
// Calculate the position to center the popup
const left = (window.innerWidth / 2) - (width / 2);
const top = (window.innerHeight / 2) - (height / 2);
// Open the popup window with the calculated position
window.open('../Forms/signIn.html', 'popup', `width=${width},height=${height},top=${top},left=${left}`);
}</code>
<code>function openCreateAccountForm() { // Dimensions for the popup window const width = 500; const height = 500; // Calculate the position to center the popup const left = (window.innerWidth / 2) - (width / 2); const top = (window.innerHeight / 2) - (height / 2); // Open the popup window with the calculated position window.open('../Forms/createAccount.html', 'popup', `width=${width},height=${height},top=${top},left=${left}`); } function openSignInForm() { // Dimensions for the popup window const width = 500; const height = 500; // Calculate the position to center the popup const left = (window.innerWidth / 2) - (width / 2); const top = (window.innerHeight / 2) - (height / 2); // Open the popup window with the calculated position window.open('../Forms/signIn.html', 'popup', `width=${width},height=${height},top=${top},left=${left}`); }</code>
function openCreateAccountForm() {
  // Dimensions for the popup window
  const width = 500;
  const height = 500;

  // Calculate the position to center the popup
  const left = (window.innerWidth / 2) - (width / 2);
  const top = (window.innerHeight / 2) - (height / 2);

  // Open the popup window with the calculated position
  window.open('../Forms/createAccount.html', 'popup', `width=${width},height=${height},top=${top},left=${left}`);
}

function openSignInForm() {
  // Dimensions for the popup window
  const width = 500;
  const height = 500;

  // Calculate the position to center the popup
  const left = (window.innerWidth / 2) - (width / 2);
  const top = (window.innerHeight / 2) - (height / 2);

  // Open the popup window with the calculated position
  window.open('../Forms/signIn.html', 'popup', `width=${width},height=${height},top=${top},left=${left}`);
}
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<script src="https://code.createjs.com/1.0.0/easeljs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.1/gsap.min.js"></script>
<link rel="stylesheet" href="../static/background1.css">
<link rel="stylesheet" href="../static/signInPage.css">
<div class="musicContainer">
<audio class="loungeMusic" controls loop>
<source src="https://www.dropbox.com/scl/fi/l69tv279l3cn1ulzm4j0l/Enter-Friend.mp3?rlkey=76rteultp73bzlqn5si4m4mnx&st=gjl4htn9&dl=1" type="audio/mpeg">
</audio>
<p class="loungeMessage">Press Play Too Lounge With Me</p>
</div>
<!-- Heading's Color ans size -->
<h1>
<span class="welcome">Hello & Welcome To:</span>
<span class="redRat"> THE RED RAT'S ACRCHIVES </span>
</h1>
<!-- Paragraph text -->
<p class="welcomeMessage"> This is a collection containing the most popular browser games from all over the internet with games that are old and new. <br> I hope you will enjoy and share with your friends.<br> </p>
<br>
<p class="createAccountMessage"> Please sign in or create an account to access the website</p>
<!-- Log In Buttons-->
<div class="createAccountButton">
<button onclick="openCreateAccountForm()" id="createAccount" type="button" class="btn btn-outline-light">Create Account</button>
</div>
<div class="signInButton">
<button onclick="openSignInForm()" id="signIn" type="button" class="btn btn-outline-light">Sign In</button>
</div>
<!-- Paragraph text -->
<p class="contactInfo"> email me at [email protected] with any feedback, recommendations, or errors you encounter </p>
<img class="pfp" src="https://wallpapers.com/images/hd/pickle-rick-coming-out-of-portal-33vnk00t94f7eezj.jpg" alt="style" width="640">
<canvas id="projector" width="800" height="600"></canvas></code>
<code><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> <script src="https://code.createjs.com/1.0.0/easeljs.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.1/gsap.min.js"></script> <link rel="stylesheet" href="../static/background1.css"> <link rel="stylesheet" href="../static/signInPage.css"> <div class="musicContainer"> <audio class="loungeMusic" controls loop> <source src="https://www.dropbox.com/scl/fi/l69tv279l3cn1ulzm4j0l/Enter-Friend.mp3?rlkey=76rteultp73bzlqn5si4m4mnx&st=gjl4htn9&dl=1" type="audio/mpeg"> </audio> <p class="loungeMessage">Press Play Too Lounge With Me</p> </div> <!-- Heading's Color ans size --> <h1> <span class="welcome">Hello & Welcome To:</span> <span class="redRat"> THE RED RAT'S ACRCHIVES </span> </h1> <!-- Paragraph text --> <p class="welcomeMessage"> This is a collection containing the most popular browser games from all over the internet with games that are old and new. <br> I hope you will enjoy and share with your friends.<br> </p> <br> <p class="createAccountMessage"> Please sign in or create an account to access the website</p> <!-- Log In Buttons--> <div class="createAccountButton"> <button onclick="openCreateAccountForm()" id="createAccount" type="button" class="btn btn-outline-light">Create Account</button> </div> <div class="signInButton"> <button onclick="openSignInForm()" id="signIn" type="button" class="btn btn-outline-light">Sign In</button> </div> <!-- Paragraph text --> <p class="contactInfo"> email me at [email protected] with any feedback, recommendations, or errors you encounter </p> <img class="pfp" src="https://wallpapers.com/images/hd/pickle-rick-coming-out-of-portal-33vnk00t94f7eezj.jpg" alt="style" width="640"> <canvas id="projector" width="800" height="600"></canvas></code>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">




<script src="https://code.createjs.com/1.0.0/easeljs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.1/gsap.min.js"></script>

<link rel="stylesheet" href="../static/background1.css">
<link rel="stylesheet" href="../static/signInPage.css">



<div class="musicContainer">
  <audio class="loungeMusic" controls loop>
            <source src="https://www.dropbox.com/scl/fi/l69tv279l3cn1ulzm4j0l/Enter-Friend.mp3?rlkey=76rteultp73bzlqn5si4m4mnx&st=gjl4htn9&dl=1" type="audio/mpeg">
        </audio>
  <p class="loungeMessage">Press Play Too Lounge With Me</p>
</div>
<!-- Heading's Color ans size -->
<h1>

  <span class="welcome">Hello & Welcome To:</span>
  <span class="redRat"> THE RED RAT'S ACRCHIVES </span>

</h1>


<!-- Paragraph text -->
<p class="welcomeMessage"> This is a collection containing the most popular browser games from all over the internet with games that are old and new. <br> I hope you will enjoy and share with your friends.<br> </p>
<br>
<p class="createAccountMessage"> Please sign in or create an account to access the website</p>

<!-- Log In Buttons-->
<div class="createAccountButton">
  <button onclick="openCreateAccountForm()" id="createAccount" type="button" class="btn btn-outline-light">Create Account</button>
</div>

<div class="signInButton">
  <button onclick="openSignInForm()" id="signIn" type="button" class="btn btn-outline-light">Sign In</button>
</div>

<!-- Paragraph text -->
<p class="contactInfo"> email me at [email protected] with any feedback, recommendations, or errors you encounter </p>

<img class="pfp" src="https://wallpapers.com/images/hd/pickle-rick-coming-out-of-portal-33vnk00t94f7eezj.jpg" alt="style" width="640">


<canvas id="projector" width="800" height="600"></canvas>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>function validateForm(event) {
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const errorMessage = document.getElementById('error-message');
if (username === '' || password === '') {
event.preventDefault(); // Prevent form submission
errorMessage.textContent = 'Username and password cannot be empty';
} else {
errorMessage.textContent = ''; // Clear any previous error messages
}
}</code>
<code>function validateForm(event) { const username = document.getElementById('username').value; const password = document.getElementById('password').value; const errorMessage = document.getElementById('error-message'); if (username === '' || password === '') { event.preventDefault(); // Prevent form submission errorMessage.textContent = 'Username and password cannot be empty'; } else { errorMessage.textContent = ''; // Clear any previous error messages } }</code>
function validateForm(event) {
  const username = document.getElementById('username').value;
  const password = document.getElementById('password').value;
  const errorMessage = document.getElementById('error-message');

  if (username === '' || password === '') {
    event.preventDefault(); // Prevent form submission
    errorMessage.textContent = 'Username and password cannot be empty';
  } else {
    errorMessage.textContent = ''; // Clear any previous error messages
  }
}
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #1e374f;
}
form {
border: 1px solid #ced4da;
padding: 20px;
border-radius: 5px;
background-color: rgb(95, 17, 61);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
input[type="text"],
input[type="password"] {
width: 90%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ced4da;
border-radius: 4px;
margin-top: 1px;
}
input[type="submit"] {
background-color: #6f00ff;
color: white;
border: none;
padding: 10px;
cursor: pointer;
border-radius: 4px;
}
input[type="submit"]:hover {
background-color: #0056b3;
}
.error {
color: red;
margin-top: 10px;
}</code>
<code>body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #1e374f; } form { border: 1px solid #ced4da; padding: 20px; border-radius: 5px; background-color: rgb(95, 17, 61); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } input[type="text"], input[type="password"] { width: 90%; padding: 10px; margin: 10px 0; border: 1px solid #ced4da; border-radius: 4px; margin-top: 1px; } input[type="submit"] { background-color: #6f00ff; color: white; border: none; padding: 10px; cursor: pointer; border-radius: 4px; } input[type="submit"]:hover { background-color: #0056b3; } .error { color: red; margin-top: 10px; }</code>
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #1e374f;
}

form {
  border: 1px solid #ced4da;
  padding: 20px;
  border-radius: 5px;
  background-color: rgb(95, 17, 61);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

input[type="text"],
input[type="password"] {
  width: 90%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ced4da;
  border-radius: 4px;
  margin-top: 1px;
}

input[type="submit"] {
  background-color: #6f00ff;
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  border-radius: 4px;
}

input[type="submit"]:hover {
  background-color: #0056b3;
}

.error {
  color: red;
  margin-top: 10px;
}
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><form method="post" action="../Databases/accountInfo.php" onsubmit="validateForm(event)">
<h2 style="color: rgb(255, 255, 255);">Create Account</h2>
<label style="color: rgb(255, 255, 255);" for="username">Username:</label>
<input type="text" id="username" name="username" placeholder="Enter your username" required>
<label style="color: rgb(255, 255, 255);" for="password">Password:</label>
<input type="password" id="password" name="password" placeholder="Enter your password" required>
<div id="error-message" class="error"></div>
<input type="submit" name="submit" value="Submit">
</form></code>
<code><form method="post" action="../Databases/accountInfo.php" onsubmit="validateForm(event)"> <h2 style="color: rgb(255, 255, 255);">Create Account</h2> <label style="color: rgb(255, 255, 255);" for="username">Username:</label> <input type="text" id="username" name="username" placeholder="Enter your username" required> <label style="color: rgb(255, 255, 255);" for="password">Password:</label> <input type="password" id="password" name="password" placeholder="Enter your password" required> <div id="error-message" class="error"></div> <input type="submit" name="submit" value="Submit"> </form></code>
<form method="post" action="../Databases/accountInfo.php" onsubmit="validateForm(event)">
  <h2 style="color: rgb(255, 255, 255);">Create Account</h2>
  <label style="color: rgb(255, 255, 255);" for="username">Username:</label>
  <input type="text" id="username" name="username" placeholder="Enter your username" required>

  <label style="color: rgb(255, 255, 255);" for="password">Password:</label>
  <input type="password" id="password" name="password" placeholder="Enter your password" required>

  <div id="error-message" class="error"></div>

  <input type="submit" name="submit" value="Submit">
</form>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>from flask import Flask, app, render_template, request, send_from_directory, render_template_string
app = Flask(__name__)
@app.route("/")
def signin():
return render_template("signInPage.html")
@app.route('/Forms/createAccount')
def createAccount():
return render_template('/Forms/createAccount.html')
</code>
<code>from flask import Flask, app, render_template, request, send_from_directory, render_template_string app = Flask(__name__) @app.route("/") def signin(): return render_template("signInPage.html") @app.route('/Forms/createAccount') def createAccount(): return render_template('/Forms/createAccount.html') </code>
from flask import Flask, app, render_template, request, send_from_directory, render_template_string


app = Flask(__name__)

@app.route("/")
def signin():
    return render_template("signInPage.html")

@app.route('/Forms/createAccount')
def createAccount():
    return render_template('/Forms/createAccount.html')

I have made sure the file paths are correct and my the route directories in the app.py file included above are correct. I was expecting the createAccount form and sign in forms to appear respectively when the createAccount button and sign in buttons are clicked. It works when running the script but not on a local server

New contributor

Aiden Figueroa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

4

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật