Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function theHeader(){
- /*
- Author: B Hallock
- Purpose: The site header
- */
- $fonts = array("Times", "Verdana", "Georgia");//array for font setting purposes
- echo '<header><a href="index.php"><img src="images/votewiser.png" width="300" height="150" alt="Logo"/></a>';
- if($_SESSION['loggedInFlag']!='yes') { // if the user is not logged in, display the login form
- echo '<form action="functions/action_login.php" method="post"><fieldset><ul class="credentials"><li>';
- checkErrors();
- if(isset($_SESSION['eArray'])) {
- if(isset($_SESSION['eArray']['username'])) {
- echo $_SESSION['eArray']['username'];
- }
- } //displays an error div if username is incorrect
- echo '<label>Username: </label> <input type="text" name="username" /></li>';
- echo '<li>';
- if(isset($_SESSION['eArray'])) {
- if(isset($_SESSION['eArray']['password'])) {
- echo $_SESSION['eArray']['password'];
- }
- } //displays an error div if the password is incorrect
- echo '<label>Password: </label><input type="password" name="password" /></li><li><label>Font:</label><select name="font">';
- foreach($fonts as $k => $v){ echo '<option value="'.$v.'">'.$v.'</option>'; }//generates the font selection dropdown from the $fonts array
- echo '</select></li><li><input name="Login" type="submit" value="Submit" /></li></ul></fieldset></form></header>';
- } else { //if the user is logged in, display the logout button and navigation
- echo '<form action="functions/action_logout.php" method="post">'; //logs the user out
- echo '<ul><li> </li><li> </li><li><input name="Logout" type="submit" value="Logout" /></li></ul></form>';
- theNavigation();
- checkErrors();
- echo '</header>';
- } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement