GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Super N00B question (https://gfy.com/showthread.php?t=1019221)

BJ 04-20-2011 01:22 AM

Super N00B question
 
One of my sites relies on a .js file to function. Right now anyone can see the .js file. I want to move it to a password protected folder and load it from there. So if anyone tries to see it they can't

If I password protect a folder via cpanel, put the script in that, how do I get it to load properly?

Thanks:thumbsup

daniel_webcams 04-20-2011 01:35 AM

you could do that through a htaccess file.

Allow and enable access from certain IP (your server IP)

Say you have a permanent IP and you want to administer the site via /admin and protect the directory from the rest of the world once ‘n’ for all, then you will want the following .htaccess directives:

order deny, allow
deny from all
allow from 12.34.56.78

I think this is what you need
(http://www.kavoir.com/2009/01/htacce...ry-access.html)

BJ 04-20-2011 01:39 AM

thank you sir

AdultKing 04-20-2011 01:41 AM

Does the site rely on the .js file for everybody to use the site ? or just for your use ?

BJ 04-20-2011 01:45 AM

everybody needs it or the site does not work, if someone has java disabled it offers an alternative. I just don't want people looking at the .js file

AdultKing 04-20-2011 01:46 AM

If everybody needs to use the .js file for it to work, then putting it in a password protected area will prevent browsers from loading it, thus the site will not work.

AdultKing 04-20-2011 01:48 AM

Stackoverflow reference:

http://stackoverflow.com/questions/1...avascript-code

cam_girls 04-20-2011 01:49 AM

you can't hide a client side script

HomerSimpson 04-20-2011 04:30 AM

Quote:

Originally Posted by cam_girls (Post 18072164)
you can't hide a client side script

right...
you can just encode it somehow...
but it can be decoded eventually

woj 04-20-2011 06:21 AM

you can make it harder, but you won't be able to hide it completely...

twistedkinkcash 04-20-2011 07:34 AM

This is the internets..srs bsnss

raymor 04-20-2011 11:41 AM

Quote:

Originally Posted by HomerSimpson (Post 18072415)
right...
you can just encode it somehow...
but it can be decoded eventually

And decoding it is always trivial. All one must do is replace "eval" with "alert" and it will pop up a box with the full code.
Some encoders may require that "eval" be replaced with "alert" more than once, but they are all trivial.

Quote:

if someone has java disabled it offers an alternative. I just don't want people looking at the .js file
"fart" and "fort" are two words that sound similar, but otherwise are completely unrelated.
Similarly, "JavaScript" and "Java" are two completely unrelated things created at different times
by different companies. The people selling LiveScript renamed it "JavaScript" because at the
time Java was a hot buzzword. It's the same thing as Xbox 360, Anderson Cooper 360,
Symantec Norton 360, Nordic Track 360 etc.

In other words, turning off Java affects your JavaScript just as much as turning off your XBox
affects Anderson Cooper - not at all, even though they both have "360" in their name.

TripleXPrint 04-20-2011 11:45 AM

Quote:

Originally Posted by raymor (Post 18073449)
In other words, turning off Java affects your JavaScript just as much as turning off your XBox affects Anderson Cooper - not at all, even though they both have "360" in their name.

I laughed. Good analogy. :thumbsup


All times are GMT -7. The time now is 11:15 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123