|
|
Ŭ¶ó¿ìµåű×
Javascript PHP ASP css html mysql jquery image API Mobile ¸Þ´º slide °Ô½ÃÆÇ
|
|
|
ÇöÀçÁ¢¼ÓÀÚ ¸í |
|
|
|
|
|
|
|
º¸Á¸½Ã°£ÀÌÈÄ ÀÚµ¿À¸·Î ±ÛÀÌ »èÁ¦µÇ´Â ¸Þ¸ðÀå |
|
|
|
|
¼Ò½ººÐ·ù |
¸Þ¸ðÀå,³«¼Àå |
|
|
´Ù¿î·Îµå Ƚ¼ö |
702 ȸ |
|
|
|
°£´Ü¼³¸í |
mysql+php ¸Þ¸ðÀåÀÔ´Ï´Ù. |
|
|
|
|
|
ÀÌ·ì´Ï´Ù.
Áö±ÝºÎÅÍ ÀÏÁ¤(ÀÚ½ÅÀÌ ¼³Á¤ÇÑ) º¸Á¸½Ã°£ÀÌÈÄ ÀÚµ¿À¸·Î ±ÛÀÌ »èÁ¦µÇ´Â
¸Þ¸ðÀå¿¡ ´ëÇØ °øºÎÇØ º¸°Ú½À´Ï´Ù.
¸ÕÀú ¿¹¸¦ º¸½Ã·Á¸é À§ÀÇ »çÀÌÆ®(www.formyroom.co.kr)¿¡ °¡½Ã¸é
¸ÞÀÎÆäÀÌÁö¿¡ ÀÖ½À´Ï´Ù.
Âü°í·Î ±× ¸Þ¸ðÀåÀº º¸Á¸½Ã°£ÀÌ 999 ½Ã°£ÀÎ ¸Þ¸ðÀåÀÔ´Ï´Ù.
¸ÕÀú, ÀÌ°ÍÀº ¿¹Àü¿¡ ¾îµò°¡¿¡¼ ¼Ò½º¸¦ º»ÀûÀÌ ÀÖ´Â
¾î¶² ¹Ì¿Ï¼º ¸Þ¸ðÀå¿¡¼ ¾ÆÀ̵ð¾î¸¦ Ãß°¡ÇØ ³ª¸§´ë·Î ¿Ï¼º½ÃŲ °ÍÀÔ´Ï´Ù.
ÆäÀÌÁö À̵¿¸µÅ© °Å²Ù·Î µ¹¸®´À¶ó °ñÁ» ½è½À´Ï´Ù.^^
ÀÚ ½ÃÀÛÇÕ´Ï´Ù.
-----------DB table : memo -----------------
no int(11) No 0 auto_increment P_key
name varchar(20)
email varchar(40)
memo varchar(250)
date datetime
----------- memo.php3 ----------------------------------
$connect = mysql_connect("localhost","user","passwd");
mysql_select_db("DB",$connect) or die(``mysql server¿¡
¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù.``);
//========================= ¸Þ¸ð ¸ñ·Ï ====================
//=== head.php3 =====================
include "head.php3";
//===================================
// º¸°ü Àϼö ¿Í new ¸¶Å© Ç¥½ÃÀϼö ±×¸®°í ÆäÀÌÁö À̵¿¸µÅ©¼³Á¤
gettime=24; // º¸°ü ±âÇÑ(½Ã°£)
$newtime=12; // new¸¶Å© Ç¥½Ã±âÇÑ(½Ã°£)
$scale=15; // 1ÆäÀÌÁö´ç ÀÚ·á¼ö
$page_scale=10; // 1ȸé´ç ÆäÀÌÁö¼ö
//=================================
//== ÀÔ·Â Æû ¾ç½Ä =================
$quel = "select no,name,email,memo,date_format(date,``m-d H:i``)";
$quel .= ",(UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(date))/3600 from memo order by date";
$result = mysql_query($quel,$connect);
$row=mysql_fetch_array($result);
if(!$result)
{
echo "¾Æ¹«°Íµµ ¾ø¾î¿ä.";
echo mysql_error();
exit;
}
$total = mysql_num_rows($result);
//=========== ÇöÀç ÆäÀÌÁö °è»ê ======================
if(!$start){ $start= $total-1 ;}
$page= ceil($total/($scale*$page_scale)) - ceil($start/($scale*$page_scale)) ;
echo "
<SCRIPT language=javascript> <br><br><!-- javascript <br><br>function ob(field,type){ if (!field.value && type) field.value = field.defaultValue; field.className=``input``} <br><br>function of_n(field,type) <br><br>{ if (field.value == field.defaultValue && type) <br><br>field.value = ````; <br><br>field.className=``input2`` <br><br>document.f.name.focus(); <br><br>} <br><br>function of_e(field,type) <br><br>{ if (field.value == field.defaultValue && type) <br><br>field.value = ````; <br><br>field.className=``input2`` <br><br>document.f.email.focus(); <br><br>} <br><br>function of_m(field,type) <br><br>{ if (field.value == field.defaultValue && type) <br><br>field.value = ````; <br><br>field.className=``input2`` <br><br>document.f.memo.focus(); <br><br>} <br><br><br><br>javascript ----> <br><br></SCRIPT>
");
//============== foot.php3 =====================
include "foot.php3";
//================================================
?>
------------------- ÀÚ ÀÌÁ¦ µÎ¹ø°ÀÔ´Ï´Ù.------------------
------------------- memo_ok.php3 --------------------------
$connect = mysql_connect("localhost","user","passwd");
mysql_select_db("DB",$connect) or die(``mysql server¿¡ ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù.``);
//================= ±Û ¿Ã¸®±â ====================
if($mode=="memo_ok")
{
//========= irooo ºóÄ Ãâ·Â½Ã ±×¸®°í htmlÅÂ±× »ç¿ë½Ã ¿¡·¯¹× Å×·¯¹æÁö =
//ºó ¹®ÀÚ¿ÀÎÁö °Ë»ç (°ø¹éÀ» »©°í °Ë»çÇÔ), ºó ¹®ÀÚ¿À̸é 1À» ¸®ÅÏ
function isblank($str)
{
if(eregi("[^[:space:]]",$str)) return 0;
return 1;
}
//=====================================================================
//=============== ¸Þ½ÃÁö Ãâ·Â ÇÔ¼ö ====================================
function check($message)
{
echo("
<SCRIPT> <br><br>window.alert(``$message``); <br><br>history.go(-1); <br><br></SCRIPT>
"); exit;
}
if(isblank($name)) {check("À̸§À» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù");}
if(isblank($memo)) {check("ÇÏ½Ç ¸»¾¸À» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù");}
//=============== ±âº» ÀÔ·Â °ªÀÌ Àü´Þ µÉ °æ¿ì =================================
if($name==``À̸§``) {check("À̸§À» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù");}
if($email==``E-Mail``)
{ $email=eregi_replace(``E-Mail``,````,$email); }
if($memo==``ÇÏ´Â ¸»``) {check("ÇÏ½Ç ¸»¾¸À» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù");}
//======= ÀԷ·çƾ =====================================
$memo = htmlspecialchars($memo);
$memo = ereg_replace(" "," ",$memo);
$memo = addslashes($memo);
$name = htmlspecialchars($name);
$name = ereg_replace(" "," ",$name);
$name = addslashes($name);
$date = date("Y-m-d H:i:s");
//======= ÀԷ·çƾ ³¡ ==================================
$quel="select * from memo where (UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(date))/3600 > $gettime";
$quel .= " order by date desc";
$result = mysql_query($quel,$connect);
if(!$result)
{
echo mysql_errno().":".mysql_error();
exit;
}
$list_num = mysql_num_rows($result);
// º¸°ü Àϼö°¡ Áö³ª°£ ÀÚ·áÀÇ Á¦°Å ·çƾ ====================
for($i=4;$i<$list_num;$i++)
{
mysql_data_seek($result,$i);
$late_date=mysql_result($result,$i,4);
// ¿©±â¼ 4 ´Â 5¹ø° ÇʵåÀÎ date ¸¦ °¡¸®Å²´Ù.
$quel2="delete from memo where date = ``$late_date``";
$result2=mysql_query($quel2,$connect);
if(!$result2)
{
echo mysql_errno().":".mysql_error();
exit;
}
}
//================== »õ±Û ¿Ã¸®±â ·çƾ ==============
$quel3="insert into memo values (````,``$name``,``$email``,``$memo``,``$date``)";
$result3=mysql_query($quel3,$connect);
if(!$result3)
{ echo"
<SCRIPT> <br><br>window.alert(``¸Þ¸ð ÀԷµµÁß ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.``) <br><br>histroy.go(-1) <br><br></SCRIPT>
";
exit;
}
echo "
¼º°øÀûÀ¸·Î ÀÔ·Â!!!
[ ¸ÞÀΠȨÆäÀÌÁö·Î À̵¿ ]
";
exit;
}
//================== »èÁ¦ ¸ðµå ============================
if($mode==``del``)
{
echo "
<SCRIPT> <br><br>if(confirm(``ÁøÂ¥ Áö¿ó´Ï´Ù...^^!``)) {<br><br>window.location.href=``$PHP_SELF?mode=del_ok&no=$no&start=$start`` <br><br>} <br><br>else <br><br>{ history.go(-1) <br><br>} <br><br></SCRIPT>
";
exit;
}
if($mode==``del_ok``)
{
$quel="delete from memo where no=``$no``";
$result=mysql_query($quel,$connect);
echo "
";
exit;
}
?>
------------------ ÀÚ ÀÌ»óÀÔ´Ï´Ù. -----------------
Çѹø º¸½Ã´Ï º°°Å ¾Æ´ÏÁÒ? Á¦ »çÀÌÆ®(formyroom.co.kr)¿¡ ±¸ÇöÇØ
³õÀº°Ç ȸ¿øÀÎÁõ ·çƾÀ» Ãß°¡Çؼ ´Ù½Ã ¸¸µç °Ì´Ï´Ù.
°Å±â¿¡ Ä«¸á·¹¿Â È¿°ú(°Ô½ÃÆÇ¿¡ ±ÛÀÖ¾î¿ä)±îÁö ³ÖÀº °Ì´Ï´Ù.
ºñ±³ÇϽǶ§ Âü°íÇϽñæ...
|
|
³×ƼÁð ÀÇ°ß ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.) |
|