+ 1
Can we make a password protected webpage?
I mean html code not Php..
9 Answers
+ 4
I know that. I wrote it for @EM Farih
+ 4
There is web server in front of your HTML / PHP code. Apache, nginx or similar. It is the responsibility of this web server to set password protection for an URL.
+ 3
But everyone can see the source code.
+ 3
@Vishal Prajapati no problem :)
+ 2
Yes by using JavaScript;
<SCRIPT>
var pass = prompt("Enter Password","");
if(pass == "YourPassWord"){
document.write("<H1>YOU HAVE ENTERED RIGHT PASSWORD</H1><H2>CONTENT GOES HERE</H2>");
}else{
document.write("<H1>WRONG PASSWORD</H1><H2>REFRESH TO TRY AGAIN");
}
</SCRIPT>
+ 2
@Max_N HTML is client side language so, they can ovuisely able to see source code contains may be password there is no control over that that's why Server Side Scripting is Introduced. There is no solution for that you need to use Server side scripting like PHP.
+ 2
@Max_N sorry for that. :-(
+ 2
ty
0
Oh yeah. I know that. Ngono ae gaiso