function constructFormGroup($input, $label, $fieldname) { $err = checkErrors($fieldname); return ' <div class="form-group' . $err['class'] . '"> <label for="' . $fieldname . '" class="control-label">' . $label . '</label> ' . $input . ' ' . $err['msg'] . ' </div> '; }
function uploadFile() { if (isset($_POST) && isset($_FILES['file']) && is_uploaded_file($_FILES['file']['tmp_name'])) { $file = $_FILES['file']; checkErrors($file); $fileData = fopen($_FILES['file']['tmp_name'], 'r'); $menuData = getMenuData($fileData); importMenuData($menuData); header('Location: index.php'); die("Redirected to: index.php"); } }
<!-- Change this image to your own company's logo --> <!-- The logo will automatically be resized to 39px height. --> <a href="#" id="company-branding" class="fr"><img src="images/aiesec.gif" /></a> </div> <!-- end full-width --> </div> <!-- end header --> <!-- MAIN CONTENT --> <div id="content"> <form action="login.php" method="POST" id="login-form"> <? include( 'function.php'); checkErrors();?> <fieldset> <p> <label for="login-username">Username</label> <input type="text" id="login-username" name="user" class="round full-width-input" autofocus /> </p> <p> <label for="login-password">Password</label> <input type="password" id="login-password" name="pass" class="round full-width-input" /> </p> <p> <label for="remember"> <input type="checkbox" name="remember" id="remember" value="1" /> Remember me