+ 4
How make a login form and fetch username & password also validate it from REST api call.. no use of framework. Code examples
To integrate REST api in PHP
16 ответов
+ 4
<html>
<head>
<title>Forms</title>
</head>
<body>
<script>
function checkUserAndPass() {
var userName = document.getElementById(“user”).value;
var passWord = document.getElementById(“pass”).value;
if (userName == “Rajkumar Yadav” && passWord == “SoloLearn”) {
document.write(“Correct”);
} else {
document.write(“Wrong”);
}
}
</script>
<form onSubmit = “checkUserAndPass()”>
<input type = “text” id = “user”/>
<input type = “password” id = “pass”/>
<input type = “submit”/>
</form>
</body>
</html>
+ 3
That should work:)
+ 3
you would have to run either a hash or a salt or md5 on the string that you’re using as the password and then test it using a conditional statement
+ 2
using php?
+ 2
nope
+ 2
oh wait are you asking how to do it using php
+ 2
i could write one for you and get back to you later today
+ 2
yes.....right
+ 2
I m asking how to do it using php....
+ 2
probably around 12-1 i would be finished
+ 2
thnx
+ 2
yeah i’ll write one for you that does the password and username thing in php
+ 2
I want to learn PHP codeIgniter framework
+ 2
and no problem
+ 2
sounds good
+ 1