티스토리 뷰

<view.php>

<?
	include "./dbConnect2.php";
	$no = $_GET['no'];
	$query = "select no,userId,title,content from store where no=$no";
	$result = mysqli_query($mysqli,$query);
?>

<!DOCTYPE html>
<html>
<head>
	<title></title>
	<link rel="stylesheet" type="text/css" href="./main.css">
</head>
<body topmargin=0 leftmargin=0>
	<center>
		<h1>글을 확인해보세요</h1><br>

	<table width="580" border=0 cellspacing="2" cellpadding="1">

	<?
	  while($row = mysqli_fetch_row($result))
	  {
	?>
		<tr>
			<td width=100 height=20 width="240">
				글 번호 :<?=$row[0]?> &nbsp
			</td>
			<td td width=100 height=20 width="240">
				작성자 :<?=$row[1]?> &nbsp
			</td>
		</tr>
		<tr>
			<td height=20 colspan=4 align=center>
				<?=$row[2]?> &nbsp
			</td>
		</tr>
		<tr>
			<td colspan="4">
				<pre><?=$row[3]?> &nbsp</pre>
			</td>
		</tr>
		<!--
		<tr>
			<td colspan="4">
				<img src=<?=$row[4]?>>
			</td>
		</tr>
		!-->
	<?
	  }
	?>
	  </table>
  
	<br><br>
        <table>
        	<tr>
            
                <a href=list.php>[목록보기] &nbsp</a>
                <a href=board.html>[글쓰기] &nbsp</a>
                <a href=./edit.php?no=<?=$no?>>[수정] &nbsp</a>
                <a href=./delete.php?no=<?=$no?>>[삭제] &nbsp</a>
            
            </tr>
	</table>
	</center>

</body>
</html>

 

<update.php> 글 수정

<?php 

	include "./dbConnect2.php";	
	$no = $_GET['no'];

   if($title != null)    
   {
      $sql = "update store set userId='$userId',title='$title',content='$content' where no=$no";
     /* $sql = $sql."values('$userId', '$title', '$content')"; */
      
      if($mysqli->query($sql)){
         echo "<script>alert('Success'); location.href='list.php';</script>";

      }else{
         echo "<script>alert('Failed');location.href='list.php';</script>";
      }
   }
   else {
         echo "<script>alert('no match');location.href='board.html';</script>";
   }

 ?>

 

<delete.php> 글 삭제

<?php
	include "dbConnect2.php";
	$no = $_GET['no']; 
?>

<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<link rel="stylesheet" type="text/css" href="main.css">
<center>
<body>
	<form action="./check.php?no=<?=$no?>" method="post">
	<h1>비밀번호 확인</h1>
	<table width="300" border="0" cellpadding="1">
		<tr>
			<td align="center">
				비밀번호 : <input type="password" name="userPw">
				<button type="submit">확인</button>
				<button type="button"><a href="list.php">취소</a></button>
			</td>
		</tr>
	</table>
	</form>
</body>
</center>
</html>

 

<결과물>

 

 

 

※ main.css는 각자의 취향에 맞춰 만들어주시면 됩니다 ㅎㅎㅎㅎ

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday