//print_r($result);
function lwreplace($lwchar)
{
    return str_replace(' ', '', $lwchar);
}
if (trim($_POST['user_name']) != NULL) {
    //echo($_POST['user_name']);
    //echo("<script>alert('锟斤拷锟斤拷晒锟絪s');</script>");
    //******************************锟斤拷锟斤拷锟斤拷一些锟斤拷锟斤拷没锟叫革拷锟斤拷锟睫革拷权锟斤拷*****锟斤拷锟斤拷说学院
    $tea_id = lwreplace(trim($_POST['tea_id']));
    $tea_pass = $tea_id;
    //$tea_pass=trim($_POST['tea_pass']);
    $user_name = trim($_POST['user_name']);
    $tea_sex = trim($_POST['tea_sex']);
    $tea_sch = trim($_POST['tea_sch']);
    $jud = add_tea_user($tea_id, $tea_sch, $tea_pass, $user_name, $tea_sex);
    if ($jud) {
        echo '<script>alert("锟斤拷锟接成癸拷")</script>';
    }
    //$sql="update `user_stu` set ch_name='$user_name', en_name='$en_name', stu_sex='$stu_sex', stu_maj='$stu_maj', stu_gra='$stu_gra', stu_clas='$stu_clas', stu_bir='$stu_bir', passport_id='$passport_id', stu_nation='$stu_nation', stu_address1='$stu_address1', stu_address2='$stu_address2', contact_way='$contact_way', fri_contact_way='$fri_contact_way' where stu_id='201063502140'";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>锟矫伙拷锟斤拷锟斤拷</title>

<!--lw-->
示例#2
0
        //设定上传目录
        //echo $f['type'];
        $dest = $dest_dir . '/' . $f['name'];
        //设置文件名为日期加上文件名避免重复
        $dest1 = iconv('UTF-8', 'utf-8//IGNORE', $dest);
        $r = move_uploaded_file($f['tmp_name'], $dest1);
        chmod($dest, 0755);
        //设定上传的文件的属性
        //echo('<script>alert("'.$dest1.'");window.location.href="add_many_stu.php?name="'.$dest1.'";</script>');
        sleep(1);
        set_include_path(get_include_path() . PATH_SEPARATOR . '../excel_cla/');
        include 'PHPExcel/IOFactory.php';
        include 'add_user_fun.php';
        $inputFileName = $dest1;
        //$inputFileName = './excel/stu_add.xls';
        $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
        $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
        //print_r($sheetData);
        foreach ($sheetData as $key => $value) {
            if ($key != '1') {
                $jud = add_tea_user($value['A'], $value['B'], $value['C'], $value['D'], $value['E']);
            }
        }
        if ($jud) {
            echo '增加成功';
            echo '<script>window.location.href="add_tea_up.html";alert("增加成功");</script>';
        }
    }
} else {
    echo '<script>window.location.href="add_tea_up.html";alert("请浏览文件");</script>';
}