Advertise Here

Author Topic: [Help] with my code...  (Read 14103 times)

0 Members and 1 Guest are viewing this topic.

Offline blahs

  • SMF For Free Full Member
  • *
  • Posts: 245
  • 5 out of 4 people have trouble with fractions!
    • View Profile
    • Silabsoft

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
[Help] with my code...
« on: March 11, 2008, 11:13:25 pm »
I made this code its supposed to put a password on your forums or website the default pass is "cool".

code:

Code: [Select]
<HEAD>
<SCRIPT language="JavaScript">
<!--hide

var password;

var pass1="cool";

password=prompt('Please enter your password to view this page!',' ');

if (password==pass1)
  alert('Password Correct! Click OK to enter!');
else
   {
    window.location="www.barbie.com";
    }

//-->
</SCRIPT>
</HEAD>


See var password;
This creates a variable named "password".

var pass1="cool";
This creates a password that will be accepted by the script. We name it pass1 in case we would like to have more than one acceptable password. ( ie pass2, pass3 etc. ).

password=prompt('Please enter your password to view this page!',' '); This is what creates the prompt for the user to enter a password. Whatever the user enters in the prompt will be the value of the variable "password".

if (password==pass1)
alert('Password Correct! Click OK to enter!');

This is where we verify the password. The variable "password" is what the user just typed into the prompt. The variable "pass1" is the only password we will accept. If they are the same, we send them an alert that the password was OK and they can continue.

else
{
window.location="www.barbie.com";
}
This is what happens when they type in an incorrect password. We send them to a page of our choice. In IE4, it looks like nothing happened, it just reloads this page. In NS3 and 4 you will probably see the protected page for a quarter of a second. I said it wasn't the most secure script out there, so I would recommend the links at the end of the tutorial so you can get a more secure script. I chose to send it back to this page (jpass.htm), but you can type any url here you want. Maybe you could use something like:
window.location="http://www.barbie.com";
Make them cringe a little.......thats what mine is...
When i tried on test forum it kept redirecting me to a weird site it was and advertizing site didn't evan ask for pass whats wrong with it???


« Last Edit: March 14, 2008, 07:40:32 pm by blahs »

Offline Celebrus

  • SMF For Free Hero
  • *
  • Posts: 941
    • View Profile
    • Vikhyat Korrapati

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #1 on: March 12, 2008, 12:37:17 am »
Try
Code: [Select]
<script type="text/javascript">
<!-- // hide

var password;

var pass1="cool";

password=prompt('Please enter your password to view this page!',' ');

if (password==pass1) {
  alert('Password Correct! Click OK to enter!');
}
else {
    window.location="http://www.barbie.com/";
}

// -->
</script>

Offline blahs

  • SMF For Free Full Member
  • *
  • Posts: 245
  • 5 out of 4 people have trouble with fractions!
    • View Profile
    • Silabsoft

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #2 on: March 12, 2008, 09:32:51 am »
Try
Code: [Select]
<script type="text/javascript">
<!-- // hide

var password;

var pass1="cool";

password=prompt('Please enter your password to view this page!',' ');

if (password==pass1) {
  alert('Password Correct! Click OK to enter!');
}
else {
    window.location="http://www.barbie.com/";
}

// -->
</script>
dang now it ruins it it dosen't ask for pass just directs to barbie.com can a staff member here take that code of its in the headers at http://tteessttforum.smfforfree4.com/index.php

Offline Celebrus

  • SMF For Free Hero
  • *
  • Posts: 941
    • View Profile
    • Vikhyat Korrapati

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #3 on: March 12, 2008, 09:48:00 am »
Why not disable javascript and get rid of the code? It's working for me btw.

Offline blahs

  • SMF For Free Full Member
  • *
  • Posts: 245
  • 5 out of 4 people have trouble with fractions!
    • View Profile
    • Silabsoft

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #4 on: March 12, 2008, 09:49:57 am »
Why not disable javascript and get rid of the code? It's working for me btw.
how do i disable/inable?

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Help] with my code...
« Reply #5 on: March 12, 2008, 10:29:11 am »
Why not disable javascript and get rid of the code? It's working for me btw.
how do i disable/inable?

To disable Javascript in Firefox: 
Tools > Options >  Content >  take checkmark out of  "enable Javascript"  in Firefox

To disable Javascript in Internet Explorer:
From the Tools menu, choose Internet Options... .
Click the Security tab.
Click Custom Level... .
Scroll to the "Scripting" section of the list. Click Disable or Enable.
Close and restart your browser.

Offline blahs

  • SMF For Free Full Member
  • *
  • Posts: 245
  • 5 out of 4 people have trouble with fractions!
    • View Profile
    • Silabsoft

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #6 on: March 13, 2008, 07:58:55 am »
Why not disable javascript and get rid of the code? It's working for me btw.
how do i disable/inable?

To disable Javascript in Firefox: 
Tools > Options >  Content >  take checkmark out of  "enable Javascript"  in Firefox

To disable Javascript in Internet Explorer:
From the Tools menu, choose Internet Options... .
Click the Security tab.
Click Custom Level... .
Scroll to the "Scripting" section of the list. Click Disable or Enable.
Close and restart your browser.

It didn't work can you go on the forum and delete this code:
Code: [Select]
<script type="text/javascript">
<!-- // hide

var password;

var pass1="cool";

password=prompt('Please enter your password to view this page!',' ');

if (password==pass1) {
  alert('Password Correct! Click OK to enter!');
}
else {
    window.location="http://www.barbie.com/";
}

// -->
</script>
Ppplllleeeaassee!!! because all the codes I wrote the tests are on that forum and since i need to show them a test for the codes i need that forum working!

Offline Celebrus

  • SMF For Free Hero
  • *
  • Posts: 941
    • View Profile
    • Vikhyat Korrapati

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #7 on: March 13, 2008, 08:29:51 am »
Which browser are you using? Your test forum works fine for me. Some popups and prompts are displayed, then it asks for the password, I enter cool and then it lets me see the site.

Offline blahs

  • SMF For Free Full Member
  • *
  • Posts: 245
  • 5 out of 4 people have trouble with fractions!
    • View Profile
    • Silabsoft

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #8 on: March 13, 2008, 08:49:06 am »
Which browser are you using? Your test forum works fine for me. Some popups and prompts are displayed, then it asks for the password, I enter cool and then it lets me see the site.
really it redirects me to barbie.com im using internet explorer

Offline Celebrus

  • SMF For Free Hero
  • *
  • Posts: 941
    • View Profile
    • Vikhyat Korrapati

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #9 on: March 13, 2008, 08:55:03 am »
Try accessing your site with FF and go in and delete it.

Offline blahs

  • SMF For Free Full Member
  • *
  • Posts: 245
  • 5 out of 4 people have trouble with fractions!
    • View Profile
    • Silabsoft

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #10 on: March 13, 2008, 12:40:14 pm »
Try accessing your site with FF and go in and delete it.
once i tried getting ff but it deleted all my favourites etc. how do i get without getting rid of my internet explorer?

Offline LaundryLady

  • Helpers
  • *
  • Posts: 3253
  • Internet Challenged
    • View Profile

  • Total Badges: 26
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
Re: [Help] with my code...
« Reply #11 on: March 13, 2008, 12:48:28 pm »
Firefox is just another browser.  It doesn't delete anything.  I currently have 5 browsers on my computer.  You must not have paid attention when you were doing it.


And I Play:  Mafia-Mandemz

Offline blahs

  • SMF For Free Full Member
  • *
  • Posts: 245
  • 5 out of 4 people have trouble with fractions!
    • View Profile
    • Silabsoft

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Help] with my code...
« Reply #12 on: March 13, 2008, 01:04:18 pm »
Firefox is just another browser.  It doesn't delete anything.  I currently have 5 browsers on my computer.  You must not have paid attention when you were doing it.
can you give me the link on how to get ff without getting rid or expanding on ie?

Offline LaundryLady

  • Helpers
  • *
  • Posts: 3253
  • Internet Challenged
    • View Profile

  • Total Badges: 26
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
Re: [Help] with my code...
« Reply #13 on: March 13, 2008, 01:34:23 pm »


And I Play:  Mafia-Mandemz

Offline Max.

  • SMF For Free Sponsors
  • *
  • Posts: 779
    • View Profile

  • Total Badges: 17
    Badges: (View All)
    Windows User Topic Starter Combination Level 3 Level 2
Re: [Help] with my code...
« Reply #14 on: March 13, 2008, 02:59:30 pm »
The page takes me directly to barbie.com
So...
No help from me sorry..
Could you help me too with that?
Pm me..
Thanks

X

 

Related Topics

  Subject / Started by Replies Last post
21 Replies
12535 Views
Last post August 16, 2009, 09:16:42 pm
by [FailSafe]
8 Replies
4076 Views
Last post October 08, 2007, 10:37:44 am
by R u n e s c a p e
8 Replies
4337 Views
Last post November 15, 2007, 11:58:56 am
by simply sibyl
8 Replies
7250 Views
Last post July 09, 2008, 07:17:47 pm
by LaundryLady
1 Replies
2057 Views
Last post November 12, 2008, 07:59:32 am
by simply sibyl