Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding you validation script

Status
Not open for further replies.

spgreen

Programmer
Aug 16, 2004
21
GB
Hi All,
This might be stupid question my experience with java script is limited. my question is can you hide the client validation script you have on your page. In theory could a malicious user copy you page locally change the validation script and submit the page to your web-server effectually crashing your application.

just a though

Simon Green
 
There's 2 things you can do:

First, do all your client validation server side. This is not foolproof cause someone could hack your server to get to your code, however it's highly unlikely something like that would happen.

And second, this is the only 100% foolproof way to prevent anyone from getting your code:

Don't put it on the internet in the first place.

Other than that you're outta luck. If someone REALLY wants to get your client side code, they can. It is 1000000% impossible to completely hide that code.



-kaht

banghead.gif
 
In theory could a malicious user copy you page locally change the validation script and submit the page to your web-server effectually crashing your application.

ANSWER: For sure.


Javascript validation is only good for speeding up things on the client side and relieving the server from multiple hits thus saving some cpu cycles and processing time. However and this is a big however don't ever rely only on Javascript to check for your data.
Always, always and let me add this-> ALWAYS check things again on the server side. It seems dumb but those who thought this was dumb ended up regreting not doing it when they got hit with malicious code.

If the client can see it, then for sure can modify it.

happy programming

grtfercho çB^]\..
"Imagination is more important than Knowledge" A. Einstein
-----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top