리눅스

 

 

write.html

<!DOCTYPE HTML>

<html>

<head>
	
</head>	

<body>
	<h2>방명록 작성</h2>
	
<form action="insert.php" method="post" name="form1">
  <table border="1" width="500px">
  	<tr>
  		<td>이름</td>
  		<td><input type="text" name="name"></td>
  	</tr>
  	<tr>
  		<td>이메일</td>
  		<td><input type="text" name="email"></td>
  	</tr>
  	 <tr>
  		<td>비번</td>
  		<td><input type="text" name="passwd"></td>
  	</tr>
  	<tr>
  		<td>내용</td>
  		<td><textarea name="content" rows="8" cols="40"></textarea></td>
  	</tr>
  	
  	<tr>
  		<td colspan="2"><input type="submit" value="전송"></td>
  		
  		
  	</tr>
  	
  </table>
</form>	
	
	
</body>	
	
</html>







 

insert.php

 

<?php
    
    
 include_once("dbcon.php");
 
   $name =$_POST["name"];
   $email =$_POST["email"];
   $content=$_POST["content"];
	$passwd=$_POST["passwd"];
    $sql="
    	insert into guestbook (name, email, content, passwd, post_date)
    	values ('$name', '$email', '$content', '$passwd', now())
    ";	
	
	mysql_query($sql);
	
	
?>
<script>

location.href="list.php";
	
</script>



 

 

 

 

about author

PHRASE

Level 60  머나먼나라

자기 생각만 옳다고 고집하는 사람은 다른 사람의 의견을 제대로 받아들일 수 없다. 어떤 일에 대하여 자기 생각을 주장하기 전에 다른 사람의 말을 들어보라. 우리는 어느 쪽이 옳은지를 비교하는 습관과 태도를 가져야 한다. -알랭

댓글 ( 4)

댓글 남기기

작성
  •    
  •    
  •