Click to See Complete Forum and Search --> : Script Prompt Noobie
NoObIe
09-09-2003, 05:09 PM
hi im a noobie and i want to know how to encode java script prompt. Here is a script and can anyont tell me what to do step by step.
<SCRIPT LANGUAGE="JavaScript">
<!--
function makeArray(){
this.length = makeArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i + 1] = makeArray.arguments[i]
}
var Array = new makeArray('B','R','E','L','E','F','O','A','T');
function password() {
var pass =
(numArray[2])+(numArray[3])+(numArray[4])-(numArray[1])+(numArray[4])+(numArray[6])+(numArray[8])+(numArray[5])+(numArray[7]);
var num = 1;
var pass1 = prompt('Please Enter Your Password','');
while (num < 3) {
if (pass1 == pass) {
alert('Good Job !');
window.location='http://www.blind-dice.com/challenges/javascript/js2.cgi';
break;
}
num+=1;
var pass1 =prompt('Wrong, wrong, all wrong!.','');
}
}
// -->
</SCRIPT>
96turnerri
09-11-2003, 07:28 PM
hmm yes it doesnt do alot does it ill have a look for you see what i can do
Jupac
09-11-2003, 09:13 PM
umm it not good to do logins with javascript anyways here is a simpler script
<script type=text/javascript>
function login(){
pass = prompt('Password',"password");
if (pass=="passwordhere"){alert("ok")}
else{
alert("Wrong haha");
window.close();
}
}
</script>
<body onload="login();">
96turnerri
09-12-2003, 07:22 AM
love the little animated gif lakers01 now that script is alot easier
Jupac
09-12-2003, 09:06 PM
thx:D im happi to help;)
96turnerri
09-13-2003, 05:51 AM
just about you signature lakers01 if that was in a script on some pages, and you had a doc say info.txt would that load at the bottom of the pages it was on (or where it was put in the main page?) i am very new to php lol:confused:
NoObIe
09-13-2003, 10:30 AM
so do u know the anwaser?
96turnerri
09-13-2003, 10:36 AM
i dont know the answer to my question, but lakers01 give u an answer for your q :p
Jupac
09-13-2003, 10:40 AM
You can emble PHP with html so just put in the body and name it like index.php
An include script in PHP will include the content of the included file wherever it appears on the page. It works much like a SSI include. I use PHP includes on my site to include a header and a footer. The header contains all the code up to the content (navigation, etc) and the footer contains all the code after the content. By using these, when I update my site, I just have to make the changes to one file, and my entire site is updated.
Jupac
09-13-2003, 10:42 AM
same post time again:D
96turnerri
09-13-2003, 10:45 AM
nice one ill try that when i get home from work tonight thank you again lol
NoObIe
09-13-2003, 10:49 AM
where does the content start and stop?
Jupac
09-13-2003, 10:53 AM
HUh wat do u mean when u use a inlude the html output would be wats in the file
Let's do a quick example...
test.txt file:
<p><b>this is some text</b></p>
page.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PHP include demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?PHP
include "test.txt";
?>
</body>
</html>
Will result in this code, when you view the source of page.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PHP include demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p><b>this is some text</b></p>
</body>
</html>