I have been modifying the html.pl to suite my Web site's needs, but have come across a problem. I'm using If statements to make a different message appear based on the permissions for the user. The problem is that when I login (with different user permissions) it always displays every message instead of just the one for those permissions. Here's the code:
<P align="center">
<font face="Arial, Verdana, Helvetica">
|;
print "Welcome! Since you are an administrator, you are allowed to view, add, modify, and delete routes, as well as add, modify, and delete users." if ($per_view || $per_add || $per_del || $per_mod || $per_admin);
print "Welcome! You are allowed to view, add, modify, and delete routes." if ($per_view || $per_add || $per_del || $per_mod);
print "Welcome! You are allowed to view, add, and delete routes, as well as add, modify, and delete users." if ($per_view || $per_add || $per_del);
print "Welcome! You are allowed to view, and add routes." if ($per_view || $per_add);
print "Welcome! You are only allowed to view routes." if ($per_view);
print qq|
If you have any trouble with this system, please email <a href="mailto:WBK73G\@webknights.hypermart.net">Michael DeLong</a>.
</font>
</p>
|; &html_footer; print qq|
</td></tr>
</table>
</body>
</html>
|;
}
Here's what I get:
Welcome! Since you are an administrator, you are allowed to view, add, modify, and delete routes, as well as add, modify, and delete users.Welcome! You are allowed to view, add, modify, and delete routes.Welcome! You are allowed to view, add, and delete routes, as well as add, modify, and delete users.Welcome! You are allowed to view, and add routes.Welcome! You are only allowed to view routes. If you have any trouble with this system, please email Michael DeLong.
Any help is appreciated!
Thanks,
-Michael DeLong
<P align="center">
<font face="Arial, Verdana, Helvetica">
|;
print "Welcome! Since you are an administrator, you are allowed to view, add, modify, and delete routes, as well as add, modify, and delete users." if ($per_view || $per_add || $per_del || $per_mod || $per_admin);
print "Welcome! You are allowed to view, add, modify, and delete routes." if ($per_view || $per_add || $per_del || $per_mod);
print "Welcome! You are allowed to view, add, and delete routes, as well as add, modify, and delete users." if ($per_view || $per_add || $per_del);
print "Welcome! You are allowed to view, and add routes." if ($per_view || $per_add);
print "Welcome! You are only allowed to view routes." if ($per_view);
print qq|
If you have any trouble with this system, please email <a href="mailto:WBK73G\@webknights.hypermart.net">Michael DeLong</a>.
</font>
</p>
|; &html_footer; print qq|
</td></tr>
</table>
</body>
</html>
|;
}
Here's what I get:
Welcome! Since you are an administrator, you are allowed to view, add, modify, and delete routes, as well as add, modify, and delete users.Welcome! You are allowed to view, add, modify, and delete routes.Welcome! You are allowed to view, add, and delete routes, as well as add, modify, and delete users.Welcome! You are allowed to view, and add routes.Welcome! You are only allowed to view routes. If you have any trouble with this system, please email Michael DeLong.
Any help is appreciated!
Thanks,
-Michael DeLong