Click to See Complete Forum and Search --> : Cookies question


JOHNY
04-27-2003, 07:23 AM
Is there any possibility to protect a page (.html) form download to cookies files ??
I have go a password on a web to user gallery

That a script to that pass if anyone need:
<script Language="JavaScript">
function password (pass) {
var password = ''
if (password != null){
location.href= pass + ".html";
}
}
</script>

<FORM name="login" target="mainFrame">
<div align="center">
<INPUT NAME="pass">
<br>
<br>
<INPUT TYPE="button" VALUE="Click" onClick="password(form.pass.value)">
<INPUT TYPE="RESET" VALUE="Reset">
</div>
</form>

Is it possible to brake the password becouse a think any way is download whole page some program and then you will know what pass is (becouse you see the pass is a name of the html)
So is any possible to protect web from download (is any js block a download page to cookie??)

Thanks for any opinion and any help

Charles
04-27-2003, 07:29 AM
I'm sorry. JavaScript is not suitable for use for password protection. You'll need to use some kind of server side method. Talk to your server people to find out what is available.

JOHNY
04-27-2003, 07:48 AM
Originally posted by Charles
I'm sorry. JavaScript is not suitable for use for password protection. You'll need to use some kind of server side method. Talk to your server people to find out what is available.

Heheh I don't think so in java is possible to protect that visit that page click (http://anica.prv.pl) And try to brake into :)

JOHNY
04-27-2003, 09:00 AM
What that script do:

function gemius_parameters() {
var dt=new Date();
var url=new String();
var d=document;
url+='&tz='+dt.getTimezoneOffset();
if (d.URL) url+='&href='+escape(d.URL.substring(0,299));
var t=typeof Error;
if(t!='undefined') {
eval("try { if (top && top.document && top.document.referrer) { url+='&ref='+escape(top.document.referrer.substring(0,299))} else if(d.referrer) { url+='&ref='+escape(d.referrer.substring(0,299))} } catch(exception) { }")
} else if(d.referrer) {
url+='&ref='+escape(d.referrer.substring(0,299));
}
if (screen) {
var s=screen;
if (s.width) url+='&screen='+s.width+'x'+s.height;
if (s.colorDepth) url+='&col='+s.colorDepth;
}
return url;
}


var gemius_url=new String('http://adnet.hit.gemius.pl/_'+(new Date()).getTime()+'/dot.gif?id=Vb3QZmS8p8Jrzc0x0O3q3_N1Dw_L2HJ3a5n0PQfNV37.y7&l=7');
gemius_url+=gemius_parameters();
var gemius_image = new Image(1,1);
gemius_image.src = gemius_url;