473,804 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

include code with javascript (?)

13 New Member
Hello.


I am new to javascript, and need help with something:)

I came across this "hack my site"-site, and cant get past level 4 (lol);P I've got the source code:
Expand|Select|Wrap|Line Numbers
  1. <script src="JavaScript" type="Text/JavaScript"></script>
  2. <script language="JavaScript" type="Text/JavaScript">
  3. password=prompt('LEVEL: 4\n Enter password:','');
  4. if (password == haxx000r)
  5. {
  6. location.href= "?page=levels&level=4&pw=" + password; 
  7. }
  8. else 
  9. location.href= "?page=error"; 
  10. }
  11. </script>
  12.  
(the javascript part, which is the one requiring a password)
and read from the hint that i had to include code with javascript. The only thing i see in that code that could be preventing me from getting "password correct" when typing in haxx000r in the password prompt, is that the string should look like this: if(password == "haxx000r") (experience from Python). Am I right? and how do i solve this?
Mar 28 '08 #1
2 1554
poe
32 New Member
I don't really understand what you're trying to accomplish with this piece of code, but I think I might know what's wrong (or not).

Unless haxx000r is a variable with the contents you want to compare to you are comparing the password to a variable you've just created which will have the value 'undefined'. Put quotes around it to compare to the string "haxx000r."
Mar 29 '08 #2
rohypnol
54 New Member
The script you're making should probably set a value for haxx000r and then you type that exact value when asked by the "to be hacked" script.
Mar 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

21
3318
by: Peter Bassett | last post by:
I have a .shtml file, that displays photos, in which I wish to pass some functionality off to an Include file for reusability purposes. Unfortunately, it's not working. Here is a portion of the .shtml file: ====== <!--#include file="/tmb8/functions.inc"--> <script type="text/javascript"> var title = "Noosa, Australia - October / November 2003"
22
38565
by: Weston C | last post by:
I know of course that you can use <script src=""></script> in an HTML document to include javascript code you don't want to spill all over the page. I'm wondering if there's a way to include other pieces of javascript code from *within* javascript.... a la #include in C, @import in Java, use/require in Perl, include()/require() in PHP, etc.... Thanks, Weston
4
1783
by: Jeremy | last post by:
I have an include file which has some text such as: The quick brown fox jumped over the lazy dog I want to have a certain amount of that text to display on one page wherein the user can click a link for more of the text on a new page such as: The quick brown fox >>MORE
6
1257
by: Jamie | last post by:
Hi there, I have a bit of java script which I would like to include in all of my html pages. Is there an easy way to include it with a reference or something. I don't want to have to copy and paste the code to the top of each page as if I then change the code I have to go through all pages to change it.
5
1868
by: Tony Strazzeri | last post by:
Hi all, I a fairly new to html and Javascripting. I have been trying to write some code to hide my email address from spam harvesters. I copied the code from various web examples and modified it to suit me. The code to generate the address is in a js include file. I am using frontpage 2003 to create my web pages. My problem is that the code works OK when I test it using Frontpage's 'Preview' but does not work when I display the page...
14
2344
by: Julesh | last post by:
Hello, I am new to ASP and am trying to make some changes to some ASP 3.0 code I have inherited. I have a number of ASP pages with VBS as the base language, on each of these pages I have successfully included a piece of VBS code that produces output in a table cell by using: <!--#include file="showAnswers.inc" -->
2
1934
by: William van Zwanenberg | last post by:
Hi there, I wonder if you guys can help. I'm currently experiencing some coding problems what with trying to use PHP and javascript in tandem. What I'm ultimately trying to achieve is use Javascript to access the DOM objects of any given page within the web site I'm building to dyanamically resize any and all text elements. I have Javascript some code that works
9
1858
by: skijor | last post by:
I am converting a raw html webiste to use javascript. A lot of the html code is duplicated in many pages. Some of that code can be consolidated into javacript but I don't want to add the same functions to every page. Is there a technique to keep the functions in one file like a header file in compiled programming languages and just include them somehow? -- regards -- note: email address is never checked
4
2793
by: pythoNewbie | last post by:
Hi guys I have 2 javascript functions, First I include which does swap images whenever I pass the mouse over a certain image <script language="JavaScript" type="text/JavaScript" src="includes/MapScript.js"></script> then I wanted to include another function inside a table <td> tag that moves text in a way similar to marquee.
3
5892
omerbutt
by: omerbutt | last post by:
hi there i am trying to run the lightbox and a slider on a single page the light box is working allrigh but when i try to include the slider in the same page it generates error because i have to include the jquery.js file to run it .i think it is a problem with the order of the file include. the error which i receive is here and on the prototype.js which is included for the lightbox i am stucked please any one here error: my code is...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10594
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10087
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.