묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
또 하나의 질문 더 있습니다.
2003.04.14 20:33
이건 회원정보 수정인데 그 전의 페이지에서 데이터는 가져옵니다. 그러나 수정이 db에 입력이 되지 않습니다. 그리고 수정과 삭제 페이지가 같이 뜨는 현상이 일어나고 있습니다.
이것도 해결 좀 해주심...........^^;;
==================================================================================================
<?
$mc=mysql_connect("localhost","","");
$ms=mysql_select_db("",$mc);
$date =date('Y/m/d');
if($mode=="edit") {
$result = mysql_query("select no, Subject, date, name, mass, age, mail, tel, phone, comment, userlevel from member_table where no='$no'");
$row = mysql_fetch_object($result);
$no= $row->no;
$Subject = $row->Subject;
$date = $row->date;
$name = $row->name;
$mass = $row->mass;
$age = $row->age;
$mail = $row->mail;
$tel = $row->tel;
$phone = $row->phone;
$comment = $row->comment;
$userlevel = $row->userlevel;
?>
<HTML>
<HEAD>
<TITLE>질문자정보수정</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=euc-kr">
</HEAD>
<BODY>
<form name=edit method=post onsubmit='return check()' action="<?echo $PHP_SELF?>?mode=editact">
<table cellpadding=0 cellspacing=0 align=center width=780>
<tr bordercolor=#FFFFCC>
<td> <table cellpadding=0 cellspacing=1 align=center width=300>
<tr>
<td> <table cellpadding=0 cellspacing=0 align=center width=780>
<tr>
<td align=center bgcolor=#999999><b>질문자 정보</b></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width="100" align=center bgcolor=#999999>번호</td>
<td width="220" bgcolor="#999999" > <?echo $no?></td>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width="100" align=center bgcolor=#999999>과목</td>
<td width="220" bgcolor="#999999" > <?echo $Subject?></td>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>접수일</td>
<td width=220 bgcolor="#999999" > <?echo $date?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>이름</td>
<td width=220 bgcolor="#999999" > <?echo $name?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>매체명</td>
<td width=220 bgcolor="#999999" > <input type=text name=mass size=30 value="<?echo $mass?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>나이</td>
<td width=220 bgcolor="#999999" > <?echo $age?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>E-mail</td>
<td width=220 bgcolor="#999999" >
<input type=text name=mail size=30 value="<?echo $mail?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>TEL</td>
<td width=220 bgcolor="#999999" >
<input type=text name=tel size=30 value="<?echo $tel?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>휴대폰</td>
<td width= 220 bgcolor="#999999" >
<input type=text name=phone size=30 value="<?echo $phone?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>질문내용</td>
<td width=220 bgcolor="#999999" ><?echo $comment?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>레벨</td>
<td width=220 bgcolor="#999999" >
<input type=text name=userlevel size=30 value="<?echo $userlevel?>" class=input</td>
</tr>
</table></td>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=right bgcolor="#999999">
<input name="submit" type="submit" value="수정"></td>
</tr>
</table></td>
</tr>
</table>
</form>
</BODY>
</HTML>
<?
}
?>
<?
if($mode == "editact") {
$result = mysql_query("update member_table set mass='$mass', mail='$mail', tel='$tel', phone='$phone', userlevel='$userlevel' where no='$no'");
}
echo "<br><br><center><font size=2 color=blue>질문자 정보를 수정하였습니다.</font></center>
<a href=member_list.php><font>[List]</font></a>
";
?>
<?
if($mode == "del") {
echo "
<HTML>
<HEAD>
<TITLE>질문자정보삭제</TITLE>
<META http-equiv='Content-Type' content='text/html; charset=euc-kr'>
</HEAD>
<body>
";
echo "<br><br><br><center><font>정말로 삭제하시겠습니까?</font><br>
<a href='member.php?no=$no&mode=delact'>[예]</a><a href='javascript:history.back()'>[아니오]</a></center>
</body>
</html>
";
}
?>
<?
if($mode == "delact") {
echo "
<HTML>
<HEAD>
<TITLE>질문자정보삭제</TITLE>
<META http-equiv='Content-Type' content='text/html; charset=euc-kr'>
</HEAD>
<body>
";
$result = mysql_query("delete from member_table where no='$no'");
echo "<br><br><br><center><font>회원 정보를 수정하였습니다.
<a href=member_list.php><font>[List]</font></a>
</center>
</body>
</html>
";
}
?>
이것도 해결 좀 해주심...........^^;;
==================================================================================================
<?
$mc=mysql_connect("localhost","","");
$ms=mysql_select_db("",$mc);
$date =date('Y/m/d');
if($mode=="edit") {
$result = mysql_query("select no, Subject, date, name, mass, age, mail, tel, phone, comment, userlevel from member_table where no='$no'");
$row = mysql_fetch_object($result);
$no= $row->no;
$Subject = $row->Subject;
$date = $row->date;
$name = $row->name;
$mass = $row->mass;
$age = $row->age;
$mail = $row->mail;
$tel = $row->tel;
$phone = $row->phone;
$comment = $row->comment;
$userlevel = $row->userlevel;
?>
<HTML>
<HEAD>
<TITLE>질문자정보수정</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=euc-kr">
</HEAD>
<BODY>
<form name=edit method=post onsubmit='return check()' action="<?echo $PHP_SELF?>?mode=editact">
<table cellpadding=0 cellspacing=0 align=center width=780>
<tr bordercolor=#FFFFCC>
<td> <table cellpadding=0 cellspacing=1 align=center width=300>
<tr>
<td> <table cellpadding=0 cellspacing=0 align=center width=780>
<tr>
<td align=center bgcolor=#999999><b>질문자 정보</b></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width="100" align=center bgcolor=#999999>번호</td>
<td width="220" bgcolor="#999999" > <?echo $no?></td>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width="100" align=center bgcolor=#999999>과목</td>
<td width="220" bgcolor="#999999" > <?echo $Subject?></td>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>접수일</td>
<td width=220 bgcolor="#999999" > <?echo $date?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>이름</td>
<td width=220 bgcolor="#999999" > <?echo $name?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>매체명</td>
<td width=220 bgcolor="#999999" > <input type=text name=mass size=30 value="<?echo $mass?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>나이</td>
<td width=220 bgcolor="#999999" > <?echo $age?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>E-mail</td>
<td width=220 bgcolor="#999999" >
<input type=text name=mail size=30 value="<?echo $mail?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>TEL</td>
<td width=220 bgcolor="#999999" >
<input type=text name=tel size=30 value="<?echo $tel?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>휴대폰</td>
<td width= 220 bgcolor="#999999" >
<input type=text name=phone size=30 value="<?echo $phone?>" class=input>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td width=100 align=center bgcolor=#999999>질문내용</td>
<td width=220 bgcolor="#999999" ><?echo $comment?></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=center width=100 bgcolor=#999999>레벨</td>
<td width=220 bgcolor="#999999" >
<input type=text name=userlevel size=30 value="<?echo $userlevel?>" class=input</td>
</tr>
</table></td>
<tr>
<td> <table cellpadding=1 cellspacing=0 align=center width=780>
<tr>
<td align=right bgcolor="#999999">
<input name="submit" type="submit" value="수정"></td>
</tr>
</table></td>
</tr>
</table>
</form>
</BODY>
</HTML>
<?
}
?>
<?
if($mode == "editact") {
$result = mysql_query("update member_table set mass='$mass', mail='$mail', tel='$tel', phone='$phone', userlevel='$userlevel' where no='$no'");
}
echo "<br><br><center><font size=2 color=blue>질문자 정보를 수정하였습니다.</font></center>
<a href=member_list.php><font>[List]</font></a>
";
?>
<?
if($mode == "del") {
echo "
<HTML>
<HEAD>
<TITLE>질문자정보삭제</TITLE>
<META http-equiv='Content-Type' content='text/html; charset=euc-kr'>
</HEAD>
<body>
";
echo "<br><br><br><center><font>정말로 삭제하시겠습니까?</font><br>
<a href='member.php?no=$no&mode=delact'>[예]</a><a href='javascript:history.back()'>[아니오]</a></center>
</body>
</html>
";
}
?>
<?
if($mode == "delact") {
echo "
<HTML>
<HEAD>
<TITLE>질문자정보삭제</TITLE>
<META http-equiv='Content-Type' content='text/html; charset=euc-kr'>
</HEAD>
<body>
";
$result = mysql_query("delete from member_table where no='$no'");
echo "<br><br><br><center><font>회원 정보를 수정하였습니다.
<a href=member_list.php><font>[List]</font></a>
</center>
</body>
</html>
";
}
?>
부분 다음에 닫는괄호 위치를 echo문 다음으로 내려주셔야 할것같아요 ^^;
그리고 업데이트가 안되는건 텔넷으로 접속하셔서 직접 쿼리 해보시고
오류메시지 있나 보세요.