+ 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 Antworten
+ 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