Hi
I have made a php script where admin can approve users and once user logged in they are directed to their account page which has a contact form on that they fill out and send to the admin team, what I want though is to only display the form to users and not the admin team as they dont need the form
I have put the form on the myaccount.php page which both user and admin are directed to after logging in, is there a way to hide the form if admin logs in but display it if user logs in
Hope that makes sense
I have added the coding from the myaccount.php page below
Thank you in advance
[code=php]
<?php
include ‘dbc.php’;
page_protect();
?>
<?php
$title = “My Account”;
$pgDesc=””;
$pgKeywords=””;
include ( ‘includes/header.php’ );
?>
<body>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”5″ class=”main”>
<tr>
<td colspan=”3″> </td>
</tr>
<tr>
<td width=”160″ valign=”top”>
<?php
/*********************** MYACCOUNT MENU ****************************
This code shows my account menu only to logged in users.
Copy this code till END and place it in a new html or php where
you want to show myaccount options. This is only visible to logged in users
*******************************************************************/
if (isset($_SESSION[‘user_id’])) {?>
<div class=”myaccount”>
<p><strong>My Account</strong></p>
<a href=”myaccount.php”>My Account</a><br>
<a href=”mysettings.php”>Settings</a><br>
<a href=”logout.php”>Logout </a>
</div>
<?php }
if (checkAdmin()) {
/*******************************END**************************/
?>
<p> <a href=”admin.php”>Admin Control Panel </a></p>
<?php } ?>
<p> </p>
<p> </p>
<p> </p></td>
<td width=”732″ valign=”top”><p> </p>
<h3 class=”titlehdr”>Welcome <?php echo $_SESSION[‘user_name’];?></h3>
<?php
if (isset($_GET[‘msg’])) {
echo “<div class=”error”>$_GET[msg]</div>”;
}
?>
<?php
$rs_settings = mysql_query(“select * from users where id=’$_SESSION[user_id]'”);
?>
<?php while ($row_settings = mysql_fetch_array($rs_settings)) {?>
<form method=”post” action=”process-form.php” id=”contact-form”>
<label for=”name”>Your Name:</label>
<input id=”name” name=”name” type=”text” value=”<?php echo $_SESSION[‘user_name’];?>” disabled />
<div class=”clear”></div>
<label for=”email”>Your E-mail:</label>
<input id=”email” name=”email” type=”text” value=”<? echo $row_settings[‘user_email’]; ?>” disabled />
<div class=”clear”></div>
<label for=”phone”>Your Phone Number:</label>
<input id=”phone” name=”phone” type=”number” value=”<? echo $row_settings[‘tel’]; ?>” disabled />
<div class=”clear”></div>
<label for=”message”>Job brief:</label>
<textarea id=”message” name=”message” cols=”10″ rows=”9″></textarea>
<label title=”No worries, the text entered here is case-insensitive” for=”spamtrap”>Is Water Wet or Dry
<span class=”required”>*</span></label>
<input name=”spamtrap” id=”spamtrap” type=”text” class=”field” value=”<?= $_SESSION[‘spamtrap’]; ?>” tabindex=”6″/>
<div class=”clear”></div>
<input type=”reset” class=”iePNG” id=”clear-button” value=””/>
<input type=”submit” class=”iePNG” id=”send-button” value=””/>
<div class=”clear”></div>
</form>
<?php } ?>
</td>
<td width=”196″ valign=”top”> </td>
</tr>
<tr>
<td colspan=”3″> </td>
</tr>
</table>
<?php include( ‘includes/footer.php’ ); ?>
Kind regards
Ian