Solved

Prevent access to a visitors

Posted on 2011-09-22
2
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

762 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