473,406 Members | 2,894 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,406 software developers and data experts.

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 1308
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rob Meade | last post by:
Hi all, I am allowing a user to create a directory within my application. I have them entering the name for the directory in a form. When the form is processed I initially check for any...
2
by: R Bolling | last post by:
I am using a routine to check to see if a phone number (PK) has alread been entered, and takes the user to that record if it is found -- as follows: Private Sub...
5
by: kevinjouco | last post by:
Hello Have searched the group for a solution to the following problem without success: Table 1 has Ref No (No Duplicates) & Min Max Value Fields ie Ref No 1 Min 1 Max 10 Ref No 2 Min 11 Max...
6
by: Joey Lee | last post by:
Hi, I was wondering which is the best way of checking if a record exist in the database before inserting. There are quite a few ways I have seen. Here are some... 1> Insert and hit a...
4
sanjay123456
by: sanjay123456 | last post by:
Dear friends , I am using window os . i face a problem is that $file="D:\Domains\\naturetrailsindia.info\wwwroot\html\\"; $file=$path."\html\\"; $d = dir($file);
125
by: jacob navia | last post by:
We hear very often in this discussion group that bounds checking, or safety tests are too expensive to be used in C. Several researchers of UCSD have published an interesting paper about this...
1
by: Kevin Frey | last post by:
SQL Server allows for a user to have SELECT permission on a View without that user requiring an associated SELECT permission on the underlying table that the VIEW accesses, but the user can still...
1
by: scottrichardson | last post by:
Hi guys. Great site. This site has helped me many times before. But now I have a question to which I am yet to find an answer. In a nutshell, I need to know how to check if a URL GET variable...
1
by: Orbie | last post by:
Hi All, I'm new to VB.NET and i'm looking for some help with my Windows Form. I need to check if a Commodity entered into (TextBox1.Text) already exists on my table before i insert it. I'm having...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.