Hi,

I have a web application where the users have to create an account to be able to access the entry form. I have 2 types of users, 1. Admin and 2. User. I have a Java application that is called via a link on the page, but I only want the link to work for the Admin users...

Is this possible? and if so, can you please guide me

Thanks in advance...

Recommended Answers

All 5 Replies

Display the link only if the user is admin. Don't display the link for normal users.

you can set session variables when the user login as admin .check if the session variable is set, if so then display the link or else don't

Display the link only if the user is admin. Don't display the link for normal users.

In this, you said 'display the link'.....what do you mean?

Example,

<?php
session_start();
if($_SESSION['user'] == "admin") {
 echo "<a href=link.php?user=$username&hash=some_hash_to_check_a_valid_user> Click here </a>";
} 
?>

If the user is admin, then it will show the above link. Also, in link.php, have a security check to cross check if the user is really an admin!

Hi Nav33n,

I followed your advice and I got it to work. Thanks alot...
:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.