PHP - ½º¹°¹ø°³¯ (1216)
ȸ¿ø°¡ÀÔ - DBÀÛ¼º °ú php¼Ò½º·Î DB¿¬°á
Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp.
C:\Documents and Settings\Administrator>mysql -u mysql: option -u requires an argument
C:\Documents and Settings\Administrator>mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 to server version: 4.0.22-nt
Type help; or \h for help. Type \c to clear the buffer.
mysql> use appledb; Database changed mysql> show tables; +-------------------+ | Tables_in_appledb | +-------------------+ | aaa | | bd_02 | | bd_3 | | board | | board1 | | member | | memo | | mymemo | +-------------------+ 8 rows in set (0.00 sec)
mysql> desc member; +----------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+--------------+------+-----+---------+----------------+ | num | int(11) | | PRI | NULL | auto_increment | | userid | varchar(20) | | UNI | | | | userpass | varchar(20) | | | | | | question | varchar(150) | | | | | | answer | varchar(50) | | | | | | username | varchar(30) | | | | | | email | varchar(50) | | | | | | jumin | varchar(13) | | | | | | tel | varchar(20) | | | | | | zip | varchar(7) | | | | | | address | varchar(50) | | | | | | job | varchar(50) | | | | | | hobby | varchar(50) | | | | | +----------+--------------+------+-----+---------+----------------+ 13 rows in set (0.04 sec)
mysql>
*** index.html <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN> <HTML> <HEAD> <TITLE> New Document </TITLE>
</HEAD>
<BODY> <table border=1 width=800> <tr> <td colspan=2><img src=http://www.pcall.co.kr/img/93.gif height=150></td> </tr> <tr> <td width=30% height=300 valign=top>
<form method=post action=login.php> <table border=1 width=200> <tr> <td>¾ÆÀ̵ð</td> <td><input type=text name=username size=10></td> </tr> <tr> <td>ºñ¹Ð¹øÈ£</td> <td><input type=password name=userpass size=10></td> </tr> <tr> <td colspan=2 align=center> <input type=submit value=·Î±×ÀÎ></td> </tr> </table> </form>
¸Þ´º <br> <a href=index.html?mode=home>óÀ½À¸·Î</a> <p> <a href=index.html?mode=join>ȸ¿ø°¡ÀÔ</a> <p> <a href=index.html?mode=board>°Ô½ÃÆÇ</a> <p> <a href=index.html?mode=memo>¸Þ¸ðÀå</a> <p> </td> <td align=center>
ºä <? if(!$mode){ $mode=home; } switch($mode){ case home: include
ull.html; break;
case oard: include ../board0/list.html; break;
case memo: include ..memo/memolist.html; break; case join: include
egist.html; break; } ?> </td> </tr> </table> </BODY> </HTML>
***regist.html <!--¾ÆÀ̵ð ºñ¹Ð¹øÈ£ ºñ¹Ð¹øȣȮÀÎ À̸§ À̸ÞÀÏ ÁֹιøÈ£ ÀüȹøÈ£ ÁÖ¼Ò ÇÚµåÆù Á÷¾÷ Ãë¹Ì--> <form method=post action=regist.php> <form method=post action=regist.php> <table border=1 width=500> <tr> <td>¾ÆÀ̵ð</td> <td><input type=text name=userid></td> </tr> <tr> <td>ºñ¹Ð¹øÈ£</td> <td><input type=password name=userpass1></td> </tr> <tr> <td>ºñ¹Ð¹øȣȮÀÎ</td> <td><input type=password name=userpass2></td> </tr> <tr> <td>ºñ¹Ð¹øÈ£ <br>ºÐ½Ç½ÃÁú¹®</td> <td><input type=text name=qusstion size=50></td> </tr> <tr> <td>Áú¹®´äº¯</td> <td><input type=text name=answer></td> </tr> <tr> <td>À̸§</td> <td><input type=text name=username></td> </tr> <tr> <td>À̸ÞÀÏ</td> <td><input type=text name=email></td> </tr> <tr> <td>ÁֹιøÈ£</td> <td><input type=text name=jumin1 size=6>-<input type=text name=jumin2 size=7></td> </tr> <tr> <td>ÀüȹøÈ£</td> <td><input type=text name=tell size=2>-<input type=text name=tel2 size=4>-<input type=text name=tel3 size=4></td> </tr> <tr> <td>¸ð¹ÙÀÏ</td> <td><input type=text name=userid></td> </tr> <tr> <td>¿ìÆí¹øÈ£</td> <td><input type=text name=zip1 size=3>-<input type=text name=zip2 size=3></td> </tr> <tr> <td>ÁÖ¼Ò</td> <td><input type=text name=address size=20></td> </tr> <tr> <td>Á÷¾÷</td> <td><input type=text name=job></td> </tr> <tr> <td>Ãë¹Ì</td> <td><input type=text name=hobby></td> </tr> <tr> <td colspan align=center> <input type=submit value=°¡ÀÔ> </td> </tr>
</table> </form>
***regist.php <? //ÆÄÀϸí: memberdb.php /* ¾ÆÀ̵ð : userid ºñ¹Ð¹øÈ£: userpass ºñ¹Ð¹øȣȮÀÎ: ºñ¹Ð¹øÈ£Áú¹®:question Áú¹®´äº¯: ansewr À̸§: name À̸ÞÀÏ : jumin ÁֹιøÈ£: jumin ÀüȹøÈ£ : tel ÇÚµåÆù: ÁÖ¼Ò: address Á÷¾÷: job Ãë¹Ì: hobby
*/
echo userid --- $userid<br>; echo userpass --- $userpass1<br>; echo question --- $question<br>; echo answer --- $answer<br>; echo username --- $username<br>; echo email --- $email<br>; $jumin=$jumin1 . $jumin2; echo jumin --- $jumin<br>; $tel=$tell . - . $tel2 . - . $tel3; echo el --- %tel<br>; $zip=$zip1 . - . $zip2; echo zip --- $zip<br>; echo address --- $address<br>;
$totaladdress=$zip . / . $address;
echo otaladdress --- $totaladdress<br>; echo job --- $job<br>; echo hobby --- $hobby<br>;
include connect.php;
$query=insert into member values(NULL, $userid,$userpass1,$question,$answer,$username,$email,$jumin,$tel,$zip,$totaladdress,$job,$hobby);
$resulut=mysql_query($query);
if($result){ echo ÀԷ¼º°ø; }else{ echo ÀԷ½ÇÆÐ; } /* $query=create table member( num int not null auto_increment primary key, userid varchar(20) not null unique, userpass varchar(20) not null , question varchar(150) not null, answer varchar(50) not null, username varchar(30) not null, email varchar(50) not null, jumin varchar(13) not null, tel varchar(20) not null, zip varchar(7) not null, address varchar(50) not null, job varchar(50) not null, hobby varchar(50) not null);
$result=mysql_query($query);
if($result){ echo Å×ÀÌºí »ý¼º ¼º°ø; }else{ echo Å×ÀÌºí »ý¼º ½ÇÆó; } */ ?>
***memberdb.php <? //ÆÄÀϸí: memberdb.php /* ¾ÆÀ̵ð : userid ºñ¹Ð¹øÈ£: userpass ºñ¹Ð¹øȣȮÀÎ:// ºñ¹Ð¹øÈ£Áú¹®:question Áú¹®´äº¯: ansewr À̸§: username À̸ÞÀÏ : email ÁֹιøÈ£: jumin ÀüȹøÈ£ : tel ÇÚµåÆù:// ¿ìÆí¹øÈ£: zip ÁÖ¼Ò: address Á÷¾÷: job Ãë¹Ì: hobby
*/
/* echo userid --- $userid<br>; echo userpass --- $userpass1<br>; echo question --- $question<br>; echo answer --- $answer<br>; echo email --- $email<br>; $jumin=$jumin1 . $jumin<br>; echo jumin --- $userpass1<br>; $tel=$tell . - . $tel2 . - . $tel3; echo el --- %tel<br>; $zip=$zip1 . - . $zip2; echo zip --- $zip<br>; echo address --- $address<br>; $totaladdress=$zip . /. $address;
echo job --- $job<br>; echo hobby --- $hobby<br>; */ include connect.php;
$query=create table member( num int not null auto_increment primary key, userid varchar(20) not null unique, userpass varchar(20) not null , question varchar(150) not null, answer varchar(50) not null, username varchar(30) not null, email varchar(50) not null, jumin varchar(13) not null, tel varchar(20) not null, zip varchar(7) not null, address varchar(50) not null, job varchar(50) not null, hobby varchar(50) not null);
$result=mysql_query($query)or die(mysql_error());
if($result){ echo Å×ÀÌºí »ý¼º ¼º°ø; }else{ echo Å×ÀÌºí »ý¼º ½ÇÆó; }
?>
2004 12 16 php½ºÅ͵ð
¼Ò½ºÀÚ¼¼Á¤È®ÇÏ°Ôº¸±â http://www.6VJ.com/php/php1216.txt
|