I require some simple PHP help... Any help will be much appreciated!
There are only two types of sign ins:
Username: management and Password: xxx
and
Username: employee Password: xxx
I would like to display some text on my webpage that says ‘Management Sign in Area” Only if management signs in and not display it if an employee signs in. Security is not an issue here just the ability to achieve the task.
I have to check the username they logged in with; examine the value of the
$_SERVER['REMOTE_USER'] variable.
Check the sign in username and display some text.
Moderator: General Moderators
Re: Check the sign in username and display some text.
What are you stuck on? This sounds like you just want to wrap some text/markup in a conditional.
Code: Select all
<?php if ($user == 'management'): ?>
<div>Management area</div>
<?php endif; ?>Re: Check the sign in username and display some text.
Yup that sounds right but its not working for some reason.
DO I have to I have to check the username they logged in with; examine the value of the
$_SERVER['REMOTE_USER'] variable?
DO I have to I have to check the username they logged in with; examine the value of the
$_SERVER['REMOTE_USER'] variable?
Re: Check the sign in username and display some text.
I have got it!
Wohooo feels good when you get it. Thanks Celauran for you help you are a Star!
This was it.
<?php if ($_SERVER['REMOTE_USER'] == 'management'): ?>
<div><p><a href="xxx">Click Here for Management Area</a></p></div>
<?php endif; ?>
Wohooo feels good when you get it. Thanks Celauran for you help you are a Star!
This was it.
<?php if ($_SERVER['REMOTE_USER'] == 'management'): ?>
<div><p><a href="xxx">Click Here for Management Area</a></p></div>
<?php endif; ?>