Comments on: [From scratch] How to create a login page – part 2 https://blog.debugeverything.com/from-scratch-how-to-create-a-login-page-part-2/ A new way to learn programming Fri, 13 Aug 2021 17:15:15 +0000 hourly 1 https://wordpress.org/?v=7.1.4 By: Aasheesh Agarwal https://blog.debugeverything.com/from-scratch-how-to-create-a-login-page-part-2/#comment-306 Fri, 13 Aug 2021 17:15:15 +0000 https://debugeverything.com/?p=697#comment-306 Idea:
Use Variables and save the variable value (but the info isn’t storing user data, it’ve only library data.) and use ID as username and get the id and set its innerHTML To the username and same for password.

]]>
By: Aasheesh Agarwal https://blog.debugeverything.com/from-scratch-how-to-create-a-login-page-part-2/#comment-305 Fri, 13 Aug 2021 17:10:48 +0000 https://debugeverything.com/?p=697#comment-305 Yeah! Wow! It Worked!!! Thank you so much!!!! =D

]]>
By: admin https://blog.debugeverything.com/from-scratch-how-to-create-a-login-page-part-2/#comment-291 Fri, 25 Jun 2021 09:03:20 +0000 https://debugeverything.com/?p=697#comment-291 In reply to ClapzDestiny.

Hi ClapzDestiny, (hope that’s not your real name, haha)

Thanks for your question in my blog.
I just figured out that i forgot to describe where to put the JS code. Thanks for that by the way.

But, what you can do it’s simple, at the end of your tag but before the closing you will write inside the SCRIPT tag:


let userLogin = function () {
let form = document.getElementById("login-form");
let email = form.elements.namedItem("email").value;
let password = form.elements.namedItem("password").value;
let credentials = "email=" + email + "&password=" + password;
const xml = new XMLHttpRequest();

xml.onreadystatechange = function () {
if (xml.status == 200) {
console.log(xml.response);
}
};

xml.open("POST", "login.php");
xml.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xml.send(credentials);
};

This will create the function that your button will call to send the login credentials to the server.
If you have any more questions, just let me know.
I’ll updated the post as well, ASAP.

]]>
By: ClapzDestiny https://blog.debugeverything.com/from-scratch-how-to-create-a-login-page-part-2/#comment-290 Thu, 24 Jun 2021 16:04:16 +0000 https://debugeverything.com/?p=697#comment-290 where do we put the “let userLogin = function () {
let form = document.getElementById(“login-form”);
let email = form.elements.namedItem(“email”).value;
let password = form.elements.namedItem(“password”).value;
let credentials = “email=” + email + “&password=” + password;
const xml = new XMLHttpRequest();

xml.onreadystatechange = function () {
if (xml.status == 200) {
console.log(xml.response);
}
};

xml.open(“POST”, “login.php”);
xml.setRequestHeader(“Content-type”, “application/x-www-form-urlencoded”);
xml.send(credentials);
};

]]>
By: [From Scratch] How to create a login page with Python - part 3 https://blog.debugeverything.com/from-scratch-how-to-create-a-login-page-part-2/#comment-62 Mon, 27 Apr 2020 04:03:33 +0000 https://debugeverything.com/?p=697#comment-62 […] page structure with CSS and HTML in part 1 and adding Javascript to send the data to the server in part 2. The time has come to talk on the server side. And this time our login page with […]

]]>
By: [From Scratch] How to build a login page using Python - part 3 https://blog.debugeverything.com/from-scratch-how-to-create-a-login-page-part-2/#comment-61 Thu, 09 Apr 2020 01:07:15 +0000 https://debugeverything.com/?p=697#comment-61 […] page structure with CSS and HTML in part 1 and adding Javascript to send the data to the server in part 2. The time has come to talk on the server side. And this time our login page is using […]

]]>