lifeseries Posted March 29, 2006 Share Posted March 29, 2006 hi, i'm a newbie here, can somebody help me with this question?i'm doing a javascript that is for login purpose, but the password can be seen in the browser>view coding. Can you guys help me?is there any way to prevent the password to be seen?thank guys... Link to comment Share on other sites More sharing options...
Rachit Shah Posted March 29, 2006 Share Posted March 29, 2006 Better use server side scripting lilke asp, php or python then only you can preven this thing. Link to comment Share on other sites More sharing options...
lifeseries Posted March 29, 2006 Author Share Posted March 29, 2006 (edited) thank for the help, i have 1 coding that will encrypt the password which mean that when user view the source code, they will the the encrypted password and not the original. <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Adobe GoLive"> <title>Untitled Page</title> <csactions> <csaction name="C05064EC0" class="Password Plus" type="onevent" val0="42732" val1="Please Proceed"></csaction> </csactions> <csscriptdict> <script type="text/javascript"><!--function CSClickReturn () { var bAgent = window.navigator.userAgent; var bAppName = window.navigator.appName; if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0)) return true; /* dont follow link */ else return false; /* dont follow link */}CSStopExecution=false;function CSAction(array) {return CSAction2(CSAct, array);}function CSAction2(fct, array) { var result; for (var i=0;i<array.length;i++) { if(CSStopExecution) return false; var aa = fct[array[i]]; if (aa == null) return false; var ta = new Array; for(var j=1;j<aa.length;j++) { if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){ if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];} else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));} else ta[j]=aa[j];} } else ta[j]=aa[j]; } result=aa[0](ta); } return result;}CSAct = new Object;var actn1 = "";var actn2 = "";var pass=""var z=23;var y=28;iCounter = 3;if (Array) { var f= new Array(); var K= new Array(); var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")} function inc(){iCounter--if (iCounter > 0) { if (confirm("\nPassword is incorrect.\n\n\n\nRetry?")) Check() } else alert('Access Denied');} function Check(){pass = prompt("Enter your password.","")if(pass==null || pass==""){ alert("You did not enter a password!"); if(pass==""){ Check() } } else{ var lpass=(pass.length)+1 for (l=1; l<lpass; l++){ K[l]=pass.charAt(l) } var transmit=0; for (y=1; y<lpass; y++){ for(x=0; x<62; x++){ if (K[y]==base[x]){ transmit+=f[x] transmit*=y } } } if (transmit==parseInt(actn1)) go() else inc()} } function go(){alert(actn2);location.href=pass+".html";} function PVpassword(action) { if (Array) { actn1 = action[1]; actn2 = action[2]; z=23; y=28; for (x=0; x<10; x++){ f[x]=x<<9 f[x]+=23 } for (x=10; x<36; x++){ y=y<<1 v= Math.sqrt(y) v = parseInt(v,16) v+=5 f[x]=v y++ } for (x=36; x<62; x++){ z=z<<1 v= Math.sqrt(z) v = parseInt(v,16) v+=74 f[x]=v z++ } iCounter = 3; Check();} }// --></script> </csscriptdict> <csactiondict> <script type="text/javascript"><!--CSAct[/*CMP*/ 'C05064EC0'] = new Array(PVpassword,'42732','Please Proceed');// --></script> </csactiondict> </head> <body bgcolor="#ffffff"> <p><a onclick="CSAction(new Array(/*CMP*/'C05064EC0'));return CSClickReturn()" href="nextpage.html" csclick="C05064EC0">Please click to enter your password</a></p> </body></html> Edited March 29, 2006 by Jonas Link to comment Share on other sites More sharing options...
scott100 Posted March 29, 2006 Share Posted March 29, 2006 That's a heck of a lot of code, as Rachit says you should use php or asp to do this, far easier. Link to comment Share on other sites More sharing options...
lifeseries Posted March 29, 2006 Author Share Posted March 29, 2006 ya i know, but i'm using mac and not pc, that why i need your help.. Link to comment Share on other sites More sharing options...
scott100 Posted March 29, 2006 Share Posted March 29, 2006 hi, i'm a newbie here, can somebody help me with this question?i'm doing a javascript that is for login purpose, but the password can be seen in the browser>view coding. Can you guys help me?is there any way to prevent the password to be seen?thank guys...<{POST_SNAPBACK}> With javascript - no. It's client side and therefore the client can see it.You could try encrypting and setting up various wild goose chases but you could never guarantee that they are secure. Some brainiac would eventually figure it out. Link to comment Share on other sites More sharing options...
lifeseries Posted March 29, 2006 Author Share Posted March 29, 2006 i see, do you have any encrypted coding for javascript as my website is not that important as for example google..at the moment i had the above coding but that will prompt a box and what i type in is not asterisk...can you guys help me on this. what i want is a password field and a submit button and not prompt box...thank... Link to comment Share on other sites More sharing options...
scott100 Posted March 29, 2006 Share Posted March 29, 2006 Is this what you want, will use a password field and a button? <html><head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Adobe GoLive"> <title>Untitled Page</title> <csactions> <csaction name="C05064EC0" class="Password Plus" type="onevent" val0="42732" val1="Please Proceed"></csaction> </csactions> <csscriptdict> <script type="text/javascript"><!--function CSClickReturn () {var bAgent = window.navigator.userAgent; var bAppName = window.navigator.appName;if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0)) return true; /* dont follow link */else return false; /* dont follow link */}CSStopExecution=false;function CSAction(array) {return CSAction2(CSAct, array);}function CSAction2(fct, array) { var result;for (var i=0;i<array.length;i++) { if(CSStopExecution) return false; var aa = fct[array[i]]; if (aa == null) return false; var ta = new Array; for(var j=1;j<aa.length;j++) { if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){ if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];} else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));} else ta[j]=aa[j];} } else ta[j]=aa[j]; } result=aa[0](ta);}return result;}CSAct = new Object;var actn1 = "";var actn2 = "";var pass=""var z=23;var y=28;iCounter = 3;if (Array) {var f= new Array();var K= new Array();var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")} function inc(){iCounter--if (iCounter > 0){if (confirm("\nPassword is incorrect.\n\n\n\nRetry?")) Check()} else alert('Access Denied');} function Check(){pass = document.getElementById('passw').value;if(pass==null || pass==""){} else{var lpass=(pass.length)+1for (l=1; l<lpass; l++){ K[l]=pass.charAt(l)} var transmit=0;for (y=1; y<lpass; y++){ for(x=0; x<62; x++){ if (K[y]==base[x]){ transmit+=f[x] transmit*=y } } } if (transmit==parseInt(actn1)) go()else inc()} } function go(){alert(actn2);location.href=pass+".html";} function PVpassword(action) { if (Array) { actn1 = action[1];actn2 = action[2];z=23;y=28;for (x=0; x<10; x++){ f[x]=x<<9 f[x]+=23} for (x=10; x<36; x++){ y=y<<1 v= Math.sqrt(y) v = parseInt(v,16) v+=5 f[x]=v y++} for (x=36; x<62; x++){ z=z<<1 v= Math.sqrt(z) v = parseInt(v,16) v+=74 f[x]=v z++} iCounter = 3;Check();} }// --></script> </csscriptdict> <csactiondict> <script type="text/javascript"><!--CSAct[/*CMP*/ 'C05064EC0'] = new Array(PVpassword,'42732','Please Proceed');// --></script> </csactiondict></head><body bgcolor="#ffffff"><input type="password" id="passw" /><input type="button" value="button" onclick="CSAction(new Array(/*CMP*/'C05064EC0'));return CSClickReturn()" /></body></html> Link to comment Share on other sites More sharing options...
Chocolate570 Posted March 29, 2006 Share Posted March 29, 2006 Please do not hijack topics. I'm splitting this one so your request can be delt with, lifeseries. Thanks. Link to comment Share on other sites More sharing options...
lifeseries Posted March 29, 2006 Author Share Posted March 29, 2006 thanks scot100, that is exactly what i want, how you do that?as i know, this coding can accept 1 password only, can it be accept more than password?For example, now the password is Hello which is linking to Hello.htmlcan it be another password linking to another page?thank guy... Link to comment Share on other sites More sharing options...
scott100 Posted March 29, 2006 Share Posted March 29, 2006 (edited) Em, im not sure what's happening here Choco was was meant to split it How did i do it? i have highlighted the changed bits in red below.I'm not sure how the coder has created the page but yes you would be able to change the password, i don't have time or patience thought to try and figure all of it out.sorryps codebox not used because it doesnt allow syntax highlighting <html><head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Adobe GoLive"> <title>Untitled Page</title> <csactions> <csaction name="C05064EC0" class="Password Plus" type="onevent" val0="42732" val1="Please Proceed"></csaction> </csactions> <csscriptdict> <script type="text/javascript"><!--function CSClickReturn () {var bAgent = window.navigator.userAgent; var bAppName = window.navigator.appName;if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0)) return true; /* dont follow link */else return false; /* dont follow link */}CSStopExecution=false;function CSAction(array) {return CSAction2(CSAct, array);}function CSAction2(fct, array) { var result;for (var i=0;i<array.length;i++) { if(CSStopExecution) return false; var aa = fct[array[i]]; if (aa == null) return false; var ta = new Array; for(var j=1;j<aa.length;j++) { if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){ if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];} else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));} else ta[j]=aa[j];} } else ta[j]=aa[j]; } result=aa[0](ta);}return result;}CSAct = new Object;var actn1 = "";var actn2 = "";var pass=""var z=23;var y=28;iCounter = 3;if (Array) {var f= new Array();var K= new Array();var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")} function inc(){iCounter--if (iCounter > 0){if (confirm("\nPassword is incorrect.\n\n\n\nRetry?")) Check()} else alert('Access Denied');} function Check(){pass = [color="red"]document.getElementById('passw').value;[/color]if(pass==null || pass==""){} else{var lpass=(pass.length)+1for (l=1; l<lpass; l++){ K[l]=pass.charAt(l)} var transmit=0;for (y=1; y<lpass; y++){ for(x=0; x<62; x++){ if (K[y]==base[x]){ transmit+=f[x] transmit*=y } } } if (transmit==parseInt(actn1)) go()else inc()} } function go(){alert(actn2);location.href=pass+".html";} function PVpassword(action) { if (Array) { actn1 = action[1];actn2 = action[2];z=23;y=28;for (x=0; x<10; x++){ f[x]=x<<9 f[x]+=23} for (x=10; x<36; x++){ y=y<<1 v= Math.sqrt(y) v = parseInt(v,16) v+=5 f[x]=v y++} for (x=36; x<62; x++){ z=z<<1 v= Math.sqrt(z) v = parseInt(v,16) v+=74 f[x]=v z++} iCounter = 3;Check();} }// --></script> </csscriptdict> <csactiondict> <script type="text/javascript"><!--CSAct[/*CMP*/ 'C05064EC0'] = new Array(PVpassword,'42732','Please Proceed');// --></script> </csactiondict></head><body bgcolor="#ffffff">[color="red"]<input type="password" id="passw" /><input type="button" value="button" onclick="CSAction(new Array(/*CMP*/'C05064EC0'));return CSClickReturn()" />[/color]</body></html> EDIT: Yeah it does... Red, see? Edited March 29, 2006 by Jonas Link to comment Share on other sites More sharing options...
Jonas Posted March 29, 2006 Share Posted March 29, 2006 Em, im not sure what's happening here Choco was was meant to split it <{POST_SNAPBACK}> Done. I also edited some stuff in this thread, as you may notice. Link to comment Share on other sites More sharing options...
pulpfiction Posted March 29, 2006 Share Posted March 29, 2006 Hi guys, sorry gave a wrong suggestion.. Link to comment Share on other sites More sharing options...
Jonas Posted March 29, 2006 Share Posted March 29, 2006 In that case they can open the script file, because you can see in the source code where to find the script and download/open it in notepad. Link to comment Share on other sites More sharing options...
pulpfiction Posted March 29, 2006 Share Posted March 29, 2006 oh yeah, never thought abt that. Link to comment Share on other sites More sharing options...
lifeseries Posted March 29, 2006 Author Share Posted March 29, 2006 <input type="button" value="button" onclick="CSAction(new Array(/*CMP*/'C05064EC0'));return CSClickReturn()" /></body>is ok, for example the code below, can it read more than 1 action, i mean at the moment it read 1 password, can it read more than 1 password?pls help me...thanks a lot Link to comment Share on other sites More sharing options...
scott100 Posted March 29, 2006 Share Posted March 29, 2006 You could read more than one password easily.the problem is that you would have to translate everything that the programmer who created it done, then adjust the code to accept two passwords.not easy Link to comment Share on other sites More sharing options...
Selacius Posted March 30, 2006 Share Posted March 30, 2006 Man, I would suggest just using PHP. Its 1000000x easier and less heart ache. I am sure you can get PHP to work on a MAC, so I don't see what the problem is. Link to comment Share on other sites More sharing options...
lifeseries Posted March 30, 2006 Author Share Posted March 30, 2006 ya i dont know about PHP language..that why i stick with this coding...can u guys help me...i really need this code to accept more than 1 password.... Link to comment Share on other sites More sharing options...
scott100 Posted March 30, 2006 Share Posted March 30, 2006 Check that your server is configured for php use.Then go through the php forms tutorial: http://www.w3schools.com/php/php_forms.asp Link to comment Share on other sites More sharing options...
lifeseries Posted March 30, 2006 Author Share Posted March 30, 2006 thank, that mean i need a database, is it? can i use microsoft access?for the previous encryping code, u really can't solve it?i really hope it can be solve because i don't know the login code in PHP..some more my company is not a web development company, is just my boss need a website to do digital image library...She always ask me why i must use the asp or php since it is window language and not universal.... Link to comment Share on other sites More sharing options...
Webworldx Posted March 30, 2006 Share Posted March 30, 2006 PHP isn't a windows-specific language, and doesn't need to be run on a microsoft box Link to comment Share on other sites More sharing options...
scott100 Posted March 30, 2006 Share Posted March 30, 2006 No you don't need a database, if its only 2 passwords you could just code them onto the page. php is not platform specific.sorry, but i'm realy not up for figuring out that last codedoes this script help you, it's pre-encrypted so you could create your own encryption.try running it through this: http://www.rlrouse.com/html-encryptor.html <head><script>function check(){var pass1=document.getElementById('1').value;var pass2=document.getElementById('2').value;if ((pass1=="hello")&&(pass2=="goodbye"))alert("Passwords are correct");else alert("2 Passwords are incorrect");}</script></head><body><form><p>Password 1 <input type="password" name="1"></p> <p>Password 2 <input type="password" name="2"></p> <input type="button" value="submit" onclick="check()" /></p></form></body> Link to comment Share on other sites More sharing options...
lifeseries Posted March 31, 2006 Author Share Posted March 31, 2006 can somebody teach me on how to connect database for php, i'm using golive cs and mac.thanks... Link to comment Share on other sites More sharing options...
lifeseries Posted March 31, 2006 Author Share Posted March 31, 2006 sorry for the database again cos i didn't see the previous post.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now