Archive for 四月, 2012

0427Prog

Web程式的基本原理->從HTML表單元件->PHP變數->SQLQuery指令

Web程式的基本原理->從HTML表單元件->PHP變數->SQLQuery指令

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,

0425MI

醫令/醫囑

醫令/醫囑

DRG

DRG

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,

0425EMath

第二章高階線性常微分方程式

第二章高階線性常微分方程式

齊性解及非齊性解

齊性解及非齊性解

特解

特解

例2.6-1

例2.6-1

例2.6-2

例2.6-2

期中考解答

期中考解答

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,

13
四月

程式設計二程式 04/06: ex-vote.php

   Posted by: admin    in 100(下)程式設計(二)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
 
<head>
<meta http-equiv='Content-Language' content='zh-tw'>
<meta http-equiv='Content-Type' content='text/html; charset=big5'>
<title>2012畢業旅行投票</title>
</head>
<body>
 
<p>2012畢業旅行投票</p>
<form method='post' action='ex-confirm.php'>
 
 
<table border='1' width='100%' id='table1'>
	<tr>
		<td align=right width=200>學號</td>
		<td><input type='text' name='SID' size='10'> </td>
	</tr>
	<tr>
		<td align=right width=200>姓名</td>
		<td><input type='text' name='SName' size='10'> </td>
	</tr>
	<tr>
		<td align=right width=200>身份證末四碼</td>
		<td><input type='text' name='SCode' size='10'></td>
	</tr>
	<tr>
		<td align=right width=200>選擇地點</td>
		<td><input type='radio' value='澎湖' name='SLoc'>澎湖
		    <input type='radio' value='花蓮' name='SLoc'>花蓮
		    <input type='radio' value='泰國' name='SLoc'>泰國</td>
	</tr>
	<tr>
		<td align=right width=200>意見</td>
		<td><input type='text' name='SComment' size='50'> </td>
	</tr>
	<tr>
		<td align=right width=200> </td>
		<td><input type='submit' name='Submit' value='投票'> </td>
	</tr>
</table>
</form>
</body>
 
</html>

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , , ,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<html>
 
<head>
<meta http-equiv='Content-Language' content='zh-tw'>
<meta http-equiv='Content-Type' content='text/html; charset=big5'>
<title>2010生姿畢業旅行投票</title>
</head>
<?php
//將表單元件的值轉成php變數
  $Var1=$_POST["SID"];
  $Var2=$_POST["SName"];
  $Var3=$_POST["SCode"];
  $Var4=$_POST["SLoc"];
  $Var5=$_POST["SComment"];
 
?>
 
<body>
 
<p>2010生姿畢業旅行投票-確認投票</p>
<form method='post' action='ex-save.php'>
 
<?php
echo "
<table border='1' width='100%' id='table1'>
	<tr>
		<td align=right width=200>學號</td>
		<td><input type='hidden' name='SID' value='$Var1'>$Var1</td>
	</tr>
	<tr>
		<td align=right width=200>姓名</td>
		<td><input type='hidden' name='SName' value='$Var2'>$Var2</td>
	</tr>
	<tr>
		<td align=right width=200>身份證末四碼</td>
		<td><input type='hidden' name='SCode' value='$Var3'>$Var3</td>
	</tr>
	<tr>
		<td align=right width=200>選擇地點</td>
		<td><input type='hidden'  name='SLoc' value='$Var4'>$Var4</td>
	</tr>
	<tr>
		<td align=right width=200>意見</td>
		<td><input type='hidden' name='SComment' value='$Var5'>$Var5</td>
	</tr>
	<tr>
		<td align=right width=200> </td>
		<td>
		";
if ($Var4=='')
   echo "沒有選擇地點<a href='javascript:history.back()'>,請回上一頁重新填寫</a>";
else
   echo "若要更改<a href='javascript:history.back()'>,請回上一頁重新填寫</a>";
echo "
		</td>
	</tr>
</table>";
?>
<hr>
<?php
//檢查是否已經報名過
if (strlen($Var1)>6)
{ 
	$link=mysql_connect("aiplab.net", "db_user", "password") or die(mysql_error());
	mysql_select_db("coursedb") or die(mysql_error());
	$query="SELECT SID, SName, SCode, SLoc, SComment, SDate FROM vote WHERE SID='$Var1'";
	$result=mysql_query($query) or die(mysql_error());
	$num_rows = mysql_num_rows($result);
 
	if ($num_rows ==1)
	{
		$row = mysql_fetch_array($result);
		echo "
	您在".$row['SDate']."完成投票,您的選擇如下<br>
<table border='1' width='100%' id='table1'>
	<tr>
		<td align=right width=200>學號</td>
		<td>".$row['SID']."</td>
	</tr>
	<tr>
		<td align=right width=200>姓名</td>
		<td>".$row['SName']."</td>
	</tr>
	<tr>
		<td align=right width=200>身份證末四碼</td>
		<td>".$row['SCode']."</td>
	</tr>
	<tr>
		<td align=right width=200>選擇地點</td>
		<td>".$row['SLoc']."</td>
	</tr>
	<tr>
		<td align=right width=200>意見</td>
		<td>".$row['SComment']."</td>
	</tr>
	<tr>
	 <td align=right width=200>是否更新</td>
		<td align='center'>
			<input type='hidden' name='SMethod' value='update' >
			<input type='submit' name='Submit' value='重新投票'> 
		</td>
	</tr>
</table>	 
		";
	}
	else
	{
if ($Var1<>''&&$Var2<>''&&$Var3<>''&&$Var4<>'')//要有前四欄資料才能存檔
		echo "
		<table border='1' width='100%' id='table1'>
			<tr>
				<td align='center'>
					<input type='hidden' name='SMethod' value='insert' >
					<input type='submit' name='Submit' value='確認投票'> 
				</td>
			</tr>
		</table>
";
 
	}
 
}
?>
</form>
</body>
 
</html>

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , , ,