470,616 Members | 2,262 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,616 developers. It's quick & easy.

checking entry...

Does anyone have some code that checks the page that the user entered from?
I know it's pretty simple to do, but I can't seem to find the right way to
do it. I just want to check the previous page to redirect if coming in from
the wrong page.

Also, is there anyway to do this for an exe to protect the download of an
exe? Thank you ver much in advance.
Jul 20 '05 #1
6 1254
Lee
arenaTR said:

Does anyone have some code that checks the page that the user entered from?
I know it's pretty simple to do, but I can't seem to find the right way to
do it. I just want to check the previous page to redirect if coming in from
the wrong page.

Also, is there anyway to do this for an exe to protect the download of an
exe? Thank you ver much in advance.


The best way to do either of these is on the server, rather than in
Javascript in the page. Server-side code is the only way to protect
the exe. How to do it depends on what server-side capabilities you
have, and is probably beyond the scope of this newsgroup.

Jul 20 '05 #2

"Lee" <RE**************@cox.net> wrote in message
news:c2*********@drn.newsguy.com...
arenaTR said:

Does anyone have some code that checks the page that the user entered from?I know it's pretty simple to do, but I can't seem to find the right way todo it. I just want to check the previous page to redirect if coming in fromthe wrong page.

Also, is there anyway to do this for an exe to protect the download of an
exe? Thank you ver much in advance.


The best way to do either of these is on the server, rather than in
Javascript in the page. Server-side code is the only way to protect
the exe. How to do it depends on what server-side capabilities you
have, and is probably beyond the scope of this newsgroup.


Thank you very much for getting back to me. Good suggestion on the
server-side stuff. I'm not as concerned about that now as the client-side.
Is there any code I can use to prevent entry unless from a specified
location?

Thank you in advance again!
Jul 20 '05 #3
arenaTR wrote:

Thank you very much for getting back to me. Good suggestion on the
server-side stuff. I'm not as concerned about that now as the client-side.
Is there any code I can use to prevent entry unless from a specified
location?

Thank you in advance again!


Hmmmm... well, what Lee is suggesting is more important. For instance,
if I am not using a browser with javascript, what happens? If I use
that browser to get at the exe directly, what happens? These questions
can only be answered with a server-side solution.

But, as a client-side thing, you can use the document.referrer property
to decide how to hide a link, but there is still nothing stopping
someone from bypassing everything, and linking to the exe directly.

Brian

Jul 20 '05 #4

"Brian Genisio" <Br**********@yahoo.com> wrote in message
news:40********@10.10.0.241...
arenaTR wrote:

Thank you very much for getting back to me. Good suggestion on the
server-side stuff. I'm not as concerned about that now as the client-side. Is there any code I can use to prevent entry unless from a specified
location?

Thank you in advance again!


Hmmmm... well, what Lee is suggesting is more important. For instance,
if I am not using a browser with javascript, what happens? If I use
that browser to get at the exe directly, what happens? These questions
can only be answered with a server-side solution.

But, as a client-side thing, you can use the document.referrer property
to decide how to hide a link, but there is still nothing stopping
someone from bypassing everything, and linking to the exe directly.

Brian


Brian:

Thanks so much for your help, it worked on the client side.

That was easy, though. Any ideas where I can learn about doing a
server-side check as well? Or perhaps I can learn from some sample code,
etc.? Thanks again everyone!
Jul 20 '05 #5
arenaTR wrote:
"Brian Genisio" <Br**********@yahoo.com> wrote in message
news:40********@10.10.0.241...
arenaTR wrote:

Thank you very much for getting back to me. Good suggestion on the
server-side stuff. I'm not as concerned about that now as the
client-side.
Is there any code I can use to prevent entry unless from a specified
location?

Thank you in advance again!


Hmmmm... well, what Lee is suggesting is more important. For instance,
if I am not using a browser with javascript, what happens? If I use
that browser to get at the exe directly, what happens? These questions
can only be answered with a server-side solution.

But, as a client-side thing, you can use the document.referrer property
to decide how to hide a link, but there is still nothing stopping
someone from bypassing everything, and linking to the exe directly.

Brian

Brian:

Thanks so much for your help, it worked on the client side.

That was easy, though. Any ideas where I can learn about doing a
server-side check as well? Or perhaps I can learn from some sample code,
etc.? Thanks again everyone!


For server-side, it all depends on your server-side technology. For
PHP, I know that there is a structure that gives you the information
that the browser gives the server... I dont remember what it is called,
but it keeps the referrer value in it.

Brian

Jul 20 '05 #6
arenaTR wrote:

Does anyone have some code that checks the page that the user entered from?
I know it's pretty simple to do, but I can't seem to find the right way to
do it. I just want to check the previous page to redirect if coming in from
the wrong page.

Also, is there anyway to do this for an exe to protect the download of an
exe? Thank you ver much in advance.


Arena,

Quite apart from the server-side scripting, but depending on what kind
of server you use, you could also try to protect the file against
hot-linking and bandwidth-theft (linking to the file from other sites
than your own and therefore using other people's bandwidth).

In a unix/linux apache environment, you can do this by placing a
..htaccess file in either the home directory of your site or the
subdirectory which you want to protect.
For more information, have a look at:
http://www.javascriptkit.com/howto/htaccess10.shtml or
http://www.htmlite.com/HTA013.php.
The examples they give are for images, but I would assume this will work
equally well for exe files.

Good luck, Juliette
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Rob Meade | last post: by
125 posts views Thread by jacob navia | last post: by
1 post views Thread by Kevin Frey | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.