當前位置:首頁 » 操作系統 » php注冊系統源碼

php注冊系統源碼

發布時間: 2022-09-12 08:08:52

A. 學生管理系統php源碼誰有

php學生管理系統源碼,供大家參考,具體內容如下

功能:

1.添加/刪除/修改
2.數據存儲.
界面分布:
index.php
--->主界面
add.php --->stu添加
action ---> sql中add/del/update
(處理html表單-->mysql的數據存儲 && 頁面跳轉)
edit.php --->stu修改
menu.php
-->首頁

1. index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>學生信息管理</title>
<script>
function doDel(id) {
if(confirm('確認刪除?')) {
window.location='action.php?action=del&id='+id;
}
}
</script>
</head>
<body>
<center>
<?php
include ("menu.php");
?>
<h3>瀏覽學生信息</h3>
<table width="500" border="1">
<tr>
<th>ID</th>
<th>姓名</th>
<th>性別</th>
<th>年齡</th>
<th>班級</th>
<th>操作</th>
</tr>
<?php
// 1. 鏈接資料庫
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
die('connection failed'.$e->getMessage());
}
//2.執行sql
$sql_select = "select * from stu";
//3.data 解析
foreach ( $pdo->query($sql_select) as $row) {
echo "<tr>";
echo "<th>{$row['id']} </th>";
echo "<th>{$row['name']}</th>";
echo "<th>{$row['sex']} </th>";
echo "<th>{$row['age']} </th>";
echo "<th>{$row['classid']}</th>";
echo "<td>
<a href='edit.php?id={$row['id']}'>修改</a>
<a href='javascript:void(0);' onclick='doDel({$row['id']})'>刪除</a>
</td>";
echo "</tr>";
}
?>
</table>
</center>
</body>
</html>

2. add.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>學生管理系統</title>
</head>
<body>
<center>

<?php include ('menu.php'); ?>
<h3>增加學生信息</h3>
<form action="action.php?action=add" method="post">
<table>
<tr>
<td>姓名</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>年齡</td>
<td><input type="text" name="age"></td>
</tr>
<tr>
<td>性別</td>
<td><input type="radio" name="sex" value="男">男</td>
<td><input type="radio" name="sex" value="女">女</td>
</tr>
<tr>
<td>班級</td>
<td><input type="text" name="classid"></td>
</tr>
<tr>
<!-- <td> </td>-->
<td><a href="index.php">返回</td>
<td><input type="submit" value="添加"></td>
<td><input type="reset" value="重置"></td>
</tr>
</table>
</form>

</center>
</body>
</html>

3. action.php
<?php
/**
* Created by PhpStorm.
* User: hyh
* Date: 16-7-7
* Time: 下午9:37
*/
//1. 鏈接資料庫
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
// echo 'Connection failed: ' . $e->getMessage();
die('connection failed'.$e->getMessage());
}

//2.action 的值做對操作

switch ($_GET['action']){

case 'add'://add
$name = $_POST['name'];
$sex = $_POST['sex'];
$age = $_POST['age'];
$classid = $_POST['classid'];

$sql = "insert into stu (name, sex, age, classid) values ('{$name}', '{$sex}','{$age}','{$classid}')";
$rw = $pdo->exec($sql);
if ($rw > 0){
echo "<script>alter('添加成功');</script>";
}else{
echo "<script>alter('添加失敗');</script>";
}
header('Location: index.php');
break;

case 'del'://get
$id = $_GET['id'];
$sql = "delete from stu where id={$id}";
$rw = $pdo->exec($sql);
if ($rw > 0){
echo "<script>alter('刪除成功');</script>";
}else{
echo "<script>alter('刪除失敗');</script>";
}
header('Location: index.php');
break;

case 'edit'://post
$id = $_POST['id'];
$name = $_POST['name'];
$age = $_POST['age'];
$classid = $_POST['classid'];
$sex = $_POST['sex'];

// echo $id, $age, $age, $name;
$sql = "update stu set name='{$name}', age={$age},sex='{$sex}',classid={$classid} where id={$id};";
// $sql = "update myapp.stu set name='jike',sex='女', age=24,classid=44 where id=17";
print $sql;
$rw = $pdo->exec($sql);
if ($rw > 0){
echo "<script>alter('更新成功');</script>";
}else{
echo "<script>alter('更新失敗');</script>";
}
header('Location: index.php');
break;

default:
header('Location: index.php');
break;
}

4.edit.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>學生管理系統</title>
</head>
<body>
<center>
<?php include ('menu.php');
//1. 鏈接資料庫
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
die('connection failed'.$e->getMessage());
}
//2.執行sql
$sql_select = "select * from stu where id={$_GET['id']}";
$stmt = $pdo->query($sql_select);
if ($stmt->rowCount() >0) {
$stu = $stmt->fetch(PDO::FETCH_ASSOC); // 解析數據
}else{
die("no have this id:{$_GET['id']}");
}
?>

<h3>修改學生信息</h3>

<form action="action.php?action=edit" method="post">
<input type="hidden" name="id" value="<?php echo $stu['id'];?>">
<table>
<tr>
<td>姓名</td>
<td><input type="text" name="name" value="<?php echo $stu['name'];?>"></td>
</tr>
<tr>
<td>年齡</td>
<td><input type="text" name="age" value="<?php echo $stu['age'];?>"></td>
</tr>
<tr>
<td>性別</td>
<td>
<input type="radio" name="sex" value="男" <?php echo ($stu['sex'] == "男")? "checked":"";?> >男
</td>
<td>
<input type="radio" name="sex" value="女" <?php echo ($stu['sex'] == "女")? "checked":"";?> >女
</td>
</tr>
<tr>
<td>班級</td>
<td><input type="text" name="classid" value="<?php echo $stu['classid']?>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="更新"></td>
<td><input type="reset" value="重置"></td>
</tr>
</table>
</form>

</center>

<?php
?>
</body>
</html>

5. menu.php

<!DOCTYPE html>
<html lang="en">
<body>
<h2>學生管理系統</h2>
<a href="index.php"> 瀏覽學生</a>
<a href="add.php"> 添加學生</a>
<hr>
</body>
</html>

B. 哪裡有php自助建站系統源碼

當然首推wordpress了
WordPress 是一個功能非常強大的博客系統,插件眾多,易於擴充功能。安裝和使用都非常方便。目前 WordPress 已經成為主流的Blog 搭建平台。WordPress 擁有世界上最強大的插件和模板。個人可以根據它的核心程序提供的規則自己開發模板和插件。他可以在瞬間把你的博客改變成 cms、forums、門戶等各種類型的站點。
我最近也在做小站,可惜資料庫沒有買mysql的,只能用國內的pjplog了,雖然比不上wordpress,但是感覺也能用了,呵呵。

另外像Z-Blog,Bo-Blog,Sablog(php+mysql)
oBlog等等,都不錯的。

如果對您有幫助,請記得採納為滿意答案,謝謝!祝您生活愉快!

vaela

C. php注冊源碼,高手指點下,加個什麼語句就能顯示注冊成功了,謝謝了

倒數第二的</SCRIPT>刪掉
最後的</form>移動到 </table>下面
然後在最後的php程序段里的最後加上success

D. 求PHP留言板源碼,要有注冊登錄功能的,簡單實現就好

免費的可以在源碼網站找找我們也可以定做PHP+MYSQL製作

E. 如何運行php教材管理系統源碼

系統環境變數path=C:\php 5. 使 php.ini 文件在 Windows下被 PHP 所用 系統環... phpMyAdmin並不是必需的,只是為了方便管理MySQL資料庫,本身是用PHP編寫而成.

F. 求助,請問有沒有 PHP 報名系統的源碼

首先先解壓文件,然後是相應的文件導入到相應的PHP源碼,看看有沒有安裝手冊,如果沒有,再找有沒有那個Install.php的文件了,如果有的話,就直接輸出www/後的文件路徑,進入頁面以後,就是一步步提示安裝,若是沒有找到資料庫文件夾,就在PHPMyAdmin中建一個資料庫名,裡面的表可以不用建,這樣安裝就沒問題了。 或者還有一種就是那個不用管資料庫,直接找到Install.php,然後直接安裝就行了,資料庫是自動生成的,比較簡單。 或者是下載的源代碼,其中有配置文件,只要把把配置文件調好,其中包括文件保存路徑,用戶名,密碼,網站名......等等,點擊保存就好了。 有手冊的話就仔細閱讀手冊,要注意有些講的是Lunix配置,不用去管它。 還有就是要有耐心啊,是在不會用 就行了。

G. php用戶注冊源碼,及file_get_contents json_decode的用法~ 能幫忙解決加送200分

我猜,他不一定是將那些內容加密,有可能是將數據,使用系統自定義的json函數將其格式話而已。這樣方便伺服器端的動態語言與js交互。
json_decode就是將字元串變回數據集(如數組之類),翻翻幫助手冊。
你想通過file_get_contents來拿那個列表,我到那裡觀察下,我覺得應該口口他的js,看清楚怎麼拿到數據再下手,你提問中的地址,用這種方法拿不到數據吧?

我這里討論下,好像對你沒太大幫助,唉,水平有限。
頁面中通過js來更新stations_div的內容,顯示信息。

H. php 用戶注冊源碼

<html>
<head>
<title>用戶注冊</title>
</head>
<body>
<strong>用戶注冊</strong>
<form action="reg.php" method="post">
用戶名稱:<input type="text" name="user"><br>
您的密碼:<input type="password" name="pass"><br>
確定密碼:<input type="password" name="pass2"><br>
<input type="submit" name="submit" value="注冊">
</form>
</body>
</html>
<?php
include ('conn.php'); //這里是您配置的資料庫
if($_POST[submit]){
//判斷用戶名不低於字數
$struser=strlen($_POST[user]);
if($struser <= 4){
echo "<script language=javascript>alert('注冊請輸入5位數以上');history.go(-1);</script>";
exit;
}
//判斷用戶是否存在
$users=$_POST[user];
$result=mysql_query("select * from manage where user='$users'");
$row=mysql_fetch_array($result);
if($_POST[user]==$row[user]){
echo "<script language=javascript>alert('啊!這個名字有人注冊啦!');history.go(-1);</script>";
exit;
}
//判斷用戶密碼兩次輸入正確
if($_POST[pass]!=$_POST[pass2]){
echo "<script language=javascript>alert('親,別耍我啦,兩次密碼怎麼能輸入不一樣呢?');history.go(-1);</script>";
exit;
}
$_POST[pass]=md5($_POST[pass]);
$sql=mysql_query("insert into manage(id,user,pass)
VALUES('','$_POST[user]','$_POST[pass]')
");
if($sql){
echo "<script language=javascript>alert('親,注冊成功!');history.go(-1);</script>";
}
else {
echo "<script language=javascript>alert('對不起,親!注冊失敗咯!');history.go(-1);</script>";
}
exit;
}
mysql_close($con)
?>

我自己寫的 很簡單,100%適合新人。加密了密碼,利用的是MD5

I. 跪求簡單的php用戶注冊源碼

用$_POST[ ]的方法來獲取用戶表單里填寫的信息,然後再獲取之後用php寫查詢語句,看提交的是否為空,為空則怎樣提示,不為空就查找,查找到了就登錄成功,查不到就登錄信息錯誤。

熱點內容
09壓縮餅干 發布:2025-05-15 05:05:58 瀏覽:279
迭代法編程c 發布:2025-05-15 04:58:01 瀏覽:815
用什麼dns伺服器地址快 發布:2025-05-15 04:52:59 瀏覽:27
手機端so反編譯 發布:2025-05-15 04:50:55 瀏覽:610
linuxlamp安裝 發布:2025-05-15 04:50:45 瀏覽:578
sqlplus緩存區怎麼設置 發布:2025-05-15 04:50:44 瀏覽:858
shell腳本環境變數 發布:2025-05-15 04:45:18 瀏覽:693
安卓nba2k18什麼時候出 發布:2025-05-15 04:38:42 瀏覽:393
王者安卓轉蘋果為什麼顯示失敗 發布:2025-05-15 04:35:49 瀏覽:18
手機優酷緩存視頻格式 發布:2025-05-15 04:13:45 瀏覽:210