473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

hiding stuff

Does anyone know how I can access a variable if I set its value inside
<%@ language="javascript" %>
<%
var whatever = 1234
%>
Then later I want to check that variables value to make sure a user can
proceed.

I tried writing it out to a hidden field, but the value still appears
in the source. So either I want to make it not show up in the source,
or be able to access it later would both be acceptable solutions.
Help?!?!??!

Nov 9 '06 #1
8 1619
Jake G wrote on 09 nov 2006 in comp.lang.javascript:
Does anyone know how I can access a variable if I set its value inside
<%@ language="javascript" %>
<% var whatever = 1234 %>
That is serverside code on an ASP platform,
the variable value is not sent to the client browser.
Then later I want to check that variables value to make sure a user can
proceed.
You can only do that clientside, or you have to send it to the client in
the HTML like this:

<% = whatever %>
I tried writing it out to a hidden field, but the value still appears
in the source. So either I want to make it not show up in the source,
or be able to access it later would both be acceptable solutions.
Impossible, unless you use AJAX to fetch it later from the server, where
you should have put it in a session variable or a database field.

Even then, if you want to compare a value clientside, you will have to send
it to the client.

However you clould send the to be tested value to the server from
clientside to be tested there and the result could be returned to the
client by AJAX like techniques.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 9 '06 #2
I've seen this done using checksums (md5), but I dont have a minor idea
how to make a code.

This is an example of how it done:

<script language="JavaScript" type="text/JavaScript">
var answ_md5;
answ_md5 = '4136340c50a1f8b2286c0482cf3912f8'; //IMHO FAKE checksum
answ_md5 = 'c81e728d9d4c2f636f067f89cc14862c'; //IMHO
REAL checksum
function CheckAnswer() {
var answer;
answer = document.getElementById('answer');
if (hex_md5(answer.value) == answ_md5) {
return true;
} else {
document.getElementById('attempts').value++;
document.getElementById('error').innerHTML = 'Ключ "'+
answer.value +'" не подошел. Взлом неудачен.';
answer.value = '';
answer.focus();
return false;
}
}
</script>
What can you do, it make a separate *.js file and make an include
statemnet in ur page. So the javascript part wont appear in the source
code of ur document, but the link to the js file will. So anyone would
be able to download it and read the code.
Evertjan. wrote:
Jake G wrote on 09 nov 2006 in comp.lang.javascript:
Does anyone know how I can access a variable if I set its value inside
<%@ language="javascript" %>
<% var whatever = 1234 %>

That is serverside code on an ASP platform,
the variable value is not sent to the client browser.
Then later I want to check that variables value to make sure a user can
proceed.

You can only do that clientside, or you have to send it to the client in
the HTML like this:

<% = whatever %>
I tried writing it out to a hidden field, but the value still appears
in the source. So either I want to make it not show up in the source,
or be able to access it later would both be acceptable solutions.

Impossible, unless you use AJAX to fetch it later from the server, where
you should have put it in a session variable or a database field.

Even then, if you want to compare a value clientside, you will have to send
it to the client.

However you clould send the to be tested value to the server from
clientside to be tested there and the result could be returned to the
client by AJAX like techniques.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 9 '06 #3
Ruso wrote on 09 nov 2006 in comp.lang.javascript:
Evertjan. wrote:
>>
However you clould send the to be tested value to the server from
clientside to be tested there and the result could be returned to the
client by AJAX like techniques.
[Please do not toppost on usenet]
I've seen this done using checksums (md5), but I dont have a minor
idea how to make a code.

This is an example of how it done:

<script language="JavaScript" type="text/JavaScript">
do not use language="JavaScript"
var answ_md5;
answ_md5 = '4136340c50a1f8b2286c0482cf3912f8';
//IMHO FAKE checksum
answ_md5 = 'c81e728d9d4c2f636f067f89cc14862c';
//IMHO
REAL checksum
REAL ??? In Javascript ??? Are you confusing languages?
function CheckAnswer() {
var answer;
answer = document.getElementById('answer');
var answer = document.getElementById('answer');
if (hex_md5(answer.value) == answ_md5) {
What is that function hex_md5() ???????????
return true;
} else {
document.getElementById('attempts').value++;
document.getElementById('error').innerHTML = 'Ключ "'+
answer.value +'" не подошел. Взлом неудачен.';
Does not ring a bell here ;-)
answer.value = '';
answer.focus();
return false;
}
}
</script>
Could you explain what you are trying to accomplish here?
Is this your own code?

What can you do, it make a separate *.js file and make an include
statemnet in ur page. So the javascript part wont appear in the source
code of ur document, but the link to the js file will. So anyone would
be able to download it and read the code.
Let us first concentrate on what you want to do?

As I said earlier, clientside comparison needs to divulge the comparator
string, unless perhaps you use a one way trapdoor function.

Anyway even then the boolean result can easily be manipulated.

"Smart programmers do it serverside!"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 9 '06 #4
Evertjan, as I said I dont know hoe to do it, so I think its clear that
it is not my own code. :)

I just saw this in one on-line "game" like u have a question u type an
answer and the next question/page appears if answer is coorect.

So here is the link to it, and the js function is on the source page of
each page with question.
http://hacker.sax777.com/

So you can check it urself.

Evertjan. wrote:
Ruso wrote on 09 nov 2006 in comp.lang.javascript:
Evertjan. wrote:
>
However you clould send the to be tested value to the server from
clientside to be tested there and the result could be returned to the
client by AJAX like techniques.

[Please do not toppost on usenet]
I've seen this done using checksums (md5), but I dont have a minor
idea how to make a code.

This is an example of how it done:

<script language="JavaScript" type="text/JavaScript">

do not use language="JavaScript"
var answ_md5;
answ_md5 = '4136340c50a1f8b2286c0482cf3912f8';
//IMHO FAKE checksum
answ_md5 = 'c81e728d9d4c2f636f067f89cc14862c';
//IMHO
REAL checksum

REAL ??? In Javascript ??? Are you confusing languages?
function CheckAnswer() {
var answer;
answer = document.getElementById('answer');

var answer = document.getElementById('answer');
if (hex_md5(answer.value) == answ_md5) {

What is that function hex_md5() ???????????
return true;
} else {
document.getElementById('attempts').value++;
document.getElementById('error').innerHTML = 'Ключ "'+
answer.value +'" не подошел. Взлом неудачен.';

Does not ring a bell here ;-)
answer.value = '';
answer.focus();
return false;
}
}
</script>

Could you explain what you are trying to accomplish here?
Is this your own code?

What can you do, it make a separate *.js file and make an include
statemnet in ur page. So the javascript part wont appear in the source
code of ur document, but the link to the js file will. So anyone would
be able to download it and read the code.

Let us first concentrate on what you want to do?

As I said earlier, clientside comparison needs to divulge the comparator
string, unless perhaps you use a one way trapdoor function.

Anyway even then the boolean result can easily be manipulated.

"Smart programmers do it serverside!"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 9 '06 #5
And btw here is the function md5()
http://hacker.sax777.com/md5.js
Ruso wrote:
Evertjan, as I said I dont know hoe to do it, so I think its clear that
it is not my own code. :)

I just saw this in one on-line "game" like u have a question u type an
answer and the next question/page appears if answer is coorect.

So here is the link to it, and the js function is on the source page of
each page with question.
http://hacker.sax777.com/

So you can check it urself.

Evertjan. wrote:
Ruso wrote on 09 nov 2006 in comp.lang.javascript:
Evertjan. wrote:
>>
>However you clould send the to be tested value to the server from
>clientside to be tested there and the result could be returned to the
>client by AJAX like techniques.
[Please do not toppost on usenet]
I've seen this done using checksums (md5), but I dont have a minor
idea how to make a code.
>
This is an example of how it done:
>
<script language="JavaScript" type="text/JavaScript">
do not use language="JavaScript"
var answ_md5;
answ_md5 = '4136340c50a1f8b2286c0482cf3912f8';
//IMHO FAKE checksum
answ_md5 = 'c81e728d9d4c2f636f067f89cc14862c';
//IMHO
REAL checksum
REAL ??? In Javascript ??? Are you confusing languages?
function CheckAnswer() {
var answer;
answer = document.getElementById('answer');
var answer = document.getElementById('answer');
if (hex_md5(answer.value) == answ_md5) {
What is that function hex_md5() ???????????
return true;
} else {
document.getElementById('attempts').value++;
document.getElementById('error').innerHTML = 'Ключ "'+
answer.value +'" не подошел. Взлом неудачен.';
Does not ring a bell here ;-)
answer.value = '';
answer.focus();
return false;
}
>}
</script>
Could you explain what you are trying to accomplish here?
Is this your own code?

What can you do, it make a separate *.js file and make an include
statemnet in ur page. So the javascript part wont appear in the source
code of ur document, but the link to the js file will. So anyone would
be able to download it and read the code.
Let us first concentrate on what you want to do?

As I said earlier, clientside comparison needs to divulge the comparator
string, unless perhaps you use a one way trapdoor function.

Anyway even then the boolean result can easily be manipulated.

"Smart programmers do it serverside!"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 9 '06 #6
Ruso wrote on 09 nov 2006 in comp.lang.javascript:
Evertjan, as I said I dont know hoe to do it, so I think its clear that
it is not my own code. :)
[Please do not toppost on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 9 '06 #7
Can you explain me what does toppost mean??

Thank you.
Evertjan. wrote:
Ruso wrote on 09 nov 2006 in comp.lang.javascript:
Evertjan, as I said I dont know hoe to do it, so I think its clear that
it is not my own code. :)

[Please do not toppost on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 9 '06 #8
"Ruso" <So*****@gmail.comwrote in
news:11**********************@h48g2000cwc.googlegr oups.com:
Can you explain me what does toppost mean??
Each message begins at the top and progesses through each post, until the
last post is at the bottom. This makes it easy to read.

Topposting (or top posting) means that you post your reply at the *top*
of the message. It destroys the order of the thread.

Example:
A. No.
Q. Does top-posting make sense?
Nov 9 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: F. Da Costa | last post by:
Following is a snippet of html in which I hide a whole table and try to hide a single row. Here is my question (plz don't chew my head off if its css related instead): Why does the divTable...
11
by: Lorenzo Villari | last post by:
I premise I don't know C++ well but... I wondered what is this data hiding thing... I mean, if I can look at the header (and i need it beacuse of the class), then what's hidden? Can someone give...
2
by: KHaled | last post by:
Hello.. I am developing a web page which will include style sheets, and I would like to have it so that the viewer cannot access the code, but obviously be able to see and navigate the page. ...
3
by: Sam | last post by:
I wrote a script to show or hide items in an HTML list (<ul id="stuff">) depending on whether a list-item's CLASS attribute matches an input string (catString), which is chosen from a SELECT menu....
0
by: Tom Z. | last post by:
Hi All, I'm trying to make an assembly in C# to use as a COM server. I'm building as normal and ruinning regasm at the end. Everything is generally working, except that I'm having a problem...
1
by: Tom Z. | last post by:
Hi All, I'm trying to make an assembly in C# to use as a COM server. I'm building as normal and ruinning regasm at the end. Everything is generally working, except that I'm having a problem...
12
by: Wes Spikes | last post by:
Ok, first things first: I'm a VB classic programmer and am considering upgrading now that I've seen VB2005. .NET1 & 1.5 never seemed to appeal to me, but now I'm considering the 2005. Does anyone...
16
by: Ed Mullen | last post by:
I've investigated a bit how to have hidden lines of text (could be just text or could be links) appear when clicking on a link in an HTML page. Example describing what I'd like it to look like is...
9
by: bob | last post by:
Hi, I know there exists a good reason why the designers of c++ decided that function hiding should exist. But I don't know why. Can anybody provide a good reason/example of a case where function...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.