10. Mysql을 이용한 메모장 (1) -php-

 

 

-memo.php

-memo_insert.php

-mysql_connect()

-mysql_select_db()

-mysql_close()

 

*MysqlDB연결, 선택, 닫기 :

<?

$connect=mysql_connect(DB 서버명, 아이디, 비밀번호); //서버 연결

mysql_select_db(DB); // DB 선택

mysql_close($connect); // DB 닫기

?>

 

memo.php

<table style="width:500px; height:50px; border:5px #cccccc solid;">

<tr>

<td align="center" valign="middle" colspan="3" >

메모장

</td>

</tr>

<tr>

<td align="center" valign="middle">

메모 목록 보기

</td>

<td align="center" valign="middle">

<a href="memo_insert.php"> 메모 작성하기 </a>

</td>

</tr>

</table>

 

memo_insert.php

<?

include "memo.php";

?>

<br>

<form name="iform" method="post" action="memo_update.php">

<table style="width:500px; height:50px; border:5px #cccccc solid;">

<tr>

<td align="center" valign="middle">

메모 작성 하기

</td>

</tr>

</table>

 

<table style="width:500px; height:50px; border:0;">

<tr>

<td align="center" valign="middle" style="width:100px;">

이름

</td>

<td align="center" valign="middle" style="width:400px;">

<input type="text" name="m_name" style="width:380px;">

</td>

</tr>

<tr>

<td align="center" valign="middle" style="width:100px;">

이메일

</td>

<td align="center" valign="middle" style="width:400px;">

<input type="text" name="m_email" style="width:380px;">

</td>

</tr>

<tr>

<td align="center" valign="middle" style="width:100px;">

비밀번호

</td>

<td align="center" valign="middle" style="width:400px;">

<input type="text" name="m_pass" style="width:380px;">

</td>

</tr>

<tr>

<td align="center" valign="middle" style="width:100px;">

내용

</td>

<td align="center" valign="middle" style="width:400px;">

<input type="text" name="m_memo" style="width:380px;">

</td>

</tr>

<tr>

<td align="center" valign="middle" colspan="2">

<input type="submit" value="저장">

</td>

</tr>

</table>

</form>

 

Posted by star story :

Snippet :: Code View :: "+location.href+'
'+b+"

");top.consoleRef.document.close()}$(".snippet-container").each(function(b){$(this).find("a.snippet-text").click(function(){var d=$(this).parents(".snippet-wrap").find(".snippet-formatted");var c=$(this).parents(".snippet-wrap").find(".snippet-textonly");d.toggle();c.toggle();if(c.is(":visible")){$(this).html("html")}else{$(this).html("text")}return false});$(this).find("a.snippet-window").click(function(){var c=$(this).parents(".snippet-wrap").find(".snippet-textonly").html();a(c);$(this).blur();return false})});$(".snippet-toggle").each(function(b){$(this).click(function(){$(this).parents(".snippet-container").find(".snippet-wrap").toggle()})})});