最近學校開了php課程,順便寫了個作業,分享一下吧。。。
都是很簡單的東西,新手用得著、、、
省略部分前端**、、、
首先是登入的校驗:
<?phpsession_start
();
$user = $_post['username'];
$pass = $_post['password'];
$_session['user'] = $user
;
/*$enter = $_post['login_undo'];
管理員登入的校驗
*/$flag = false
;
if($user == "admin"&& $pass == "root")
else
header('location:login.php?login=relog');
/*// 學生登入免校驗
if($enter)
header('location:stupage.php');
*/
然後是註冊的校驗:
<?phpsession_start
();
$s_id = $_post['s_id'];
$name = $_post['name'];
$idcard = $_post['idcard'];
$major = $_post['major'];
$*** = $_post['***'];
$_session['student'][$s_id]['s_id'] = $s_id
;
$_session['student'][$s_id]['name'] = $name
;
$_session['student'][$s_id]['idcard'] = $idcard
;
$_session['student'][$s_id]['major'] = $major
;
$_session['student'][$s_id]['***'] = $***
;
header('location:tisi.html');
/*foreach($_session['student'] as $v)
else
header("location:stu_reg.php?action=look&msg=增加&user=employee&empno=" . $empno . "&idcard=" . $idcard);
}*/
畢業操作及加入歷史校驗:
<?phpsession_start
();
$s_id=$_get['s_id'];
$_session['history'][$s_id]['s_id']=$s_id
;
$_session['history'][$s_id]['name']=$_session['student'][$s_id]['name'];
$_session['history'][$s_id]['idcard']=$_session['student'][$s_id]['idcard'];
$_session['history'][$s_id]['***']=$_session['student'][$s_id]['***'];
$_session['history'][$s_id]['major']=$_session['student'][$s_id]['major'];
unset($_session['student'][$s_id
]);
header('location:graduate.php?user=admin&action=delete');
<?phpsession_start
();
$search=$_post['search'];
unset($_session['search']);
/*echo '';
var_dump($_post['search']);
return ;
*/foreach ($_session['student'] as
$k1 => $value
) }
if(isset($i
))
header("location:stu_query.php?user=admin&action=search");
else
header("location:stu_query.php?user=admin&action=q_error");
遍歷學生資訊:
class="css_table" bgcolor='#e1e1e1'>
<?php
session_start
();
$user = isset($_session['user'])?$_session['user']:'';
if($user =='admin') else
if($k2=='idcard')else
if($k2=='***')else
if($k2=='name')else
if($k2 =='major');
echo "";
echo "";
if($k2=='s_id') $s_id=$k3; echo "$k3";
echo "";}}
}}?>
更新資料的頁面及校驗:
<?php if($user =='admin'&&$action=='')else
if ($action == 'change') else
if ($action == 'enchange') ?>
<?phpsession_start
();
$s_id = $_post['c_id'];
$name = $_post['name'];
$major = $_post['major'];
$*** = $_post['***'];
$_session['student'][$s_id]['s_id'] = $s_id
;
$_session['student'][$s_id]['name'] = $name
;
$_session['student'][$s_id]['major'] = $major
;
$_session['student'][$s_id]['***'] = $***
;
header("location:stu_update.php?action=enchange");
(說明:我csdn部落格的這篇是一樣的,但是我不寫csdn了
學生管理系統(陣列實現)
標頭檔案 ifndef student h define student h define n 100 struct student typedef struct student st void welcome void show int input st stu void display st s...
php學籍資訊管理系統心得 php實現學生管理系統
功能 1.新增 刪除 修改 2.資料儲存.介面分布 index.php 主介面 add.php stu新增 action sql中add del update 處理html表單 mysql的資料儲存 頁面跳轉 edit.php stu修改 menu.php 首頁 1.index.php 學生資訊管理...
Python實現學生管理系統
from prettytable import prettytable class studentinfo def init self print print 學生管理系統 v1.0 print 1 新增學生 print 2 顯示所有學生 print 3 查詢學生 print 4 修改學生 prin...