Solved

Prevent access to a visitors

Posted on 2011-09-22
2
191 Views
Last Modified: 2012-08-14
Hi,

I have a menu that has images and onclick event to go to a page.  

how can I do this:

If the user is not a member I need to send them an alert ("this feature is for members only") and prevent them from accessing the page otherwise, they will access the page.

Once the user login a cookie is created to identify the user ID and name

that's user ID cookie
(MemUserID)

User Name cookie
(MemUser)

I need this feature for the following images/menu only:
PostAd.cfm
Post.cfm

the rest of my pages anyone can access.


here's my menu.

<img style="cursor:hand;" src="images/BThome1.gif" alt="" border="0" onClick="parent.location='home.cfm';">

<img style="cursor:hand;"  src="images/BTMyAcc2.gif" alt="" border="0" onClick="parent.location='MyAcc.cfm';">

<img style="cursor:hand;"  src="images/BTPostAd1.gif" alt="" border="0" onClick="parent.location='PostAd.cfm';">

<img style="cursor:hand;"  src="images/BTSearch1.gif" alt="" border="0" onClick="parent.location='post.cfm';">

<img style="cursor:hand;"  src="images/BTChat1.gif" alt="" border="0" onClick="parent.location='Chat.cfm';">

<img style="cursor:hand;" src="images/BTHelp1.gif" alt="" border="0" onClick="parent.location='Help.cfm';">

<img style="cursor:hand;"  src="images/BTContactUs1.gif" alt="" border="0" onClick="parent.location='ContactUs.cfm';">


Thanks,
0
Comment
Question by:lulu50
2 Comments
 
LVL 6

Accepted Solution

by:
bartvd earned 500 total points
ID: 36583561
Hey,

It is not safe to do this in javascript. You should do this in a scripting language.
0
 

Author Closing Comment

by:lulu50
ID: 36719833
I agree thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question