<p>1 dbcon.php <?php $host = "127.0.0.1"; $user = "root"; $pass = "123456"; $dbname = "dbregister"; $tbuser = "tbuser"; $conn = mysql_connect($host,$user,$pass)or die("ตดต อHost ไมได<br>"); $db =mysql_select_db($dbname) or die ("ตดต อฐานขอมลไมได"); ?> FormRegister.php</p><p><!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> <meta http-equiv="Content-Type" content="text/html; charset=utf- 8" /> <title>สมมัครสมาชก</title> </head> <body> <form id="form1" name="form1" method="post" action="AddData.php"> 2</p><p><table width="60%" border="0"> <tr> <td width="90">ชชชื่อลล็อกอน</td> <td width="235"><input type="text" name="logname" id="logname" /></td> <td width="102">เพศ</td> <td width="206"><p> <label> <input type="radio" name="gender" value="male" id="gender_0" /> ชาย</label> <input type="radio" name="gender" value="female" id="gender_1" /> <label>หญง</label> <br /> </p></td> </tr> <tr> <td>รหมัสผาน </td> <td><input type="password" name="pw" id="pw" /></td> <td>อายย</td> <td><select name="age" id="age"> <option value="9-18">9-18 ปป</option> <option value="19-25">19-25 ปป</option> <option value="26-45">26-45 ปป</option> <option value="46-60">46-60 ปป</option> <option value="61-80">61-80 ปป</option> 3</p><p></select></td> </tr> <tr> <td>ชชชื่อ-นามสกยล </td> <td><input type="text" name="name" id="name" /></td> <td>งานอดเรก</td> <td><input name="hobby1" type="checkbox" id="hobby1" value="sport" /> เลนก ปฬา <br /> <input name="hobby2" type="checkbox" id="hobby2" value="reading" /> อานหนมังสชอ <br /> <input name="hobby3" type="checkbox" id="hobby3" value="tour" /> ทองเทปชื่ยว<br /> <input name="hobby4" type="checkbox" id="hobby4" value="game" /> เกม </td> </tr> <tr> <td>ทปชื่อย</td> <td><textarea name="address" id="address" cols="30" rows="5"></textarea></td> <td>รจมักเวล็บไซตต์นปน จากแหลงใด</td> <td><select name="ads" id="ads"> <option value="newspaper">หนมังสชอพมพต์</option> <option value="book">หนมังสชอในเครชอสสานมักพมพต์</option> <option value="internet">อนเตอรต์เนล็ต</option> 4</p><p><option value="poster" selected="selected">ใบปลว</option> </select></td> </tr> <tr> <td>อปเมลต์</td> <td><input name="email" type="text" id="email" size="25" /></td> <td></td> <td> </td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" id="Submit" value="สงขอมล" /></td> <td><input type="reset" name="Reset" id="Reset" value="ลาง ขอมล" /></td> <td> </td> </tr> </table> </form> </body> </html></p><p>สรรางฐานขรอมมล 5</p><p>AddData.php <?php include("dbcon.php"); $sql = "insert into `$tbuser` ( `logname` , `pw` , `name` , `address` , `age` , `gender` , `ads`, `hobby1` , `hobby2` , `hobby3` , `hobby4` , `email` ) values ('$logname', '$pw', '$name', '$address', '$age', '$gender', '$ads', '$hobby1', '$hobby2', '$hobby3', '$hobby4', '$email' )"; mysql_query("set NAMES tis620"); $sqlquery=mysql_db_query($dbname, $sql); $checkadd = "select * from `$tbuser` where logname='$logname' "; $result = mysql_db_query($dbname, $checkadd); $num=mysql_num_rows($result); if ($num==1) { print"<br>เพ ชื่มขอมลผใชลงในฐานขอมลเรปยบรอยแลว"; }elseif($num>=1) { print"<br>ช ชชื่อผใชงานซส นากรยณาใชชชชื่ออชชื่น"; }else 6</p><p>{ print"ระบบข มั ดของหรชอมปขอผดพลาด!!!"; }; mysql_close($conn); ?> fetcharray.php <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf- 8" /> <title>รายชชชื่อสมาชก</title> </head> <?php include("dbcon.php"); $sql = "select *from $tbuser "; mysql_query("set NAMES tis620"); $sqlquery=mysql_db_query($dbname, $sql); print "<h3>จสานวนผสมมัครสมาชกมปทมันงหมด ".mysql_num_rows($sqlquery)." คน ซซชื่งมปขอมลดมังนปน</h3>"; print "<table>"; print "<tr bgcolor=0066FF>"; print "<td align = center>ผใช</td>"; print "<td align = center>รหมัสผาน </td>"; print "<td align = center>อปเมล</td>"; print "<td align = center>ชชชื่อ-นามสกยล</td>"; print "<td align = center>ทปชื่อย</td>"; print "<td align = center>อายย</td>"; 7</p><p> print "<td align = center>เพศ</td>"; print "<td align = center>แหลงทปชื่มา </td>"; print "<td align = center>งานอดเรก</td>"; print "</tr>"; while ($array = mysql_fetch_array($sqlquery)) { $logname = $array['logname']; print "<tr bgcolor=00CCFF>"; print "<td>".$array['logname'] ."</td>"; print "<td>".$array['pw'] ." </td>"; print "<td>".$array['email'] ." </td>"; print "<td>".$array['name'] ." </td>"; print "<td>".$array['address'] ." </td>"; print "<td>".$array['age']." </td>"; print "<td>".$array['gender']." </td>"; print "<td>".$array['ads']." </td>"; print "<td>".$array['hobby'] ." ". $array['hobby2'] ." ".$array['hobby3']." ". $array['hobby4'] ."</td>"; print "</tr>"; } print"</table>"; mysql_close($conn); ?> </html></p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-