示例#1
0
     $errors = array();
     $errors[] = 'You must attach a check and indicate the check date in the appropriate field. <br>';
     if (!is_numeric($_POST['check_nbr'])) {
         $errors[] = 'Check Numbers can contain numerals only.';
     }
 } elseif ($_POST['status'] == 'ACCOUNTING APPROVAL' && !is_numeric($_POST['check_nbr'])) {
     $errors = array();
     $errors[] = 'Check Numbers can contain numerals only.';
 } elseif ($_POST['status'] == 'ACCOUNTING APPROVAL') {
     //var_dump($_FILES);
     echo 'do I ever come here';
     //var_dump($_POST['check']);
     echo '<br>';
     //echo $_POST['check'];
     //uploadCheck($_POST['check']);
     uploadCheck();
 }
 echo 'begg';
 echo '<br>';
 echo $_POST['status'];
 echo '<br>';
 echo strlen($_POST['check_date']);
 echo '<br>';
 echo strlen($_POST['check']);
 echo '<br>';
 echo 'end';
 if ($errors) {
     //echo $_SESSION['return_URI'];
     //save for when you go back to the form pre-fill
     //$_SESSION['SAVE_POST']=$_POST;
     //show errors at center of page
示例#2
0
include_once 'namecheck.php';
$folder = "";
/*
File Upload
*/
if (isset($_POST['upload'])) {
    if (is_uploaded_file($_FILES['UploadFile']['tmp_name'])) {
        if (!filetypeCheck($_FILES['UploadFile']['name']) || !isValid($_FILES['UploadFile']['name'], true)) {
            if ($_GET['dir']) {
                header('Location: user.php?dir=' . $_GET['dir'] . '&upload=fail2');
            } else {
                header('Location: user.php?upload=fail2');
            }
        } else {
            if ($_POST['uploaddir']) {
                if (uploadCheck($uploaddir . $_POST['uploaddir'])) {
                    move_uploaded_file($_FILES['UploadFile']['tmp_name'], $uploaddir . $_POST['uploaddir'] . '/' . $_FILES['UploadFile']['name']);
                    if (UPLOAD_ERR_OK) {
                        header('Location: user.php?dir=' . $_POST['uploaddir'] . '&upload=fail');
                    } else {
                        //	header( 'Location: user.php?dir='.$_POST['uploaddir'].'&upload=success' );
                    }
                } else {
                    header('Location: user.php?upload=fail');
                }
            } else {
                move_uploaded_file($_FILES['UploadFile']['tmp_name'], $uploaddir . "/" . $_FILES['UploadFile']['name']);
                if (UPLOAD_ERR_OK) {
                    header('Location: user.php?upload=fail');
                } else {
                    //	header( 'Location: user.php?upload=success' );