½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
happycgi
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > PHP > PHP ¼Ò½ºÃ¢°í > ¸Þ¸ðÀå,³«¼­Àå > º¸Á¸½Ã°£ÀÌÈÄ ÀÚµ¿À¸·Î ±ÛÀÌ »èÁ¦µÇ´Â ¸Þ¸ðÀå »ó¼¼Á¤º¸
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
CSS
HTML
MYSQL
jquery
image
Mobile
API
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>






















































onMouseOut="this.style.backgroundColor=````;return true;">







";

}

else

{

echo " ";

}

//==========================================================



echo "













";

}

else

{

echo " ";

}

//==========================================================



echo"













";



if(!$email)

{

echo " ";

}

else

{

echo "



";

}

echo "";

}



}

}

echo("
ÇÏ ´Â ¸» ÀÌ ¸§ ¾² ½Å ½Ã °£

";





$color = array(

"#dddddd","#bbbbbb","#999999","#777777");



//================= ÆäÀÌÁö À̵¿ ¸µÅ© ·çƾ =====================



for($i=$start ; $i> $start-$scale ; $i--) // start ¿¡¼­ scale ±îÁö ¸¸



{



if($i > -1 ) // Àüü ÀÚ·á °³¼ö±îÁö¸¸ Ãâ·Â



{



//============= irooo ÀÇ Ãâ·Â ================





//==================== »ö±ò º¯È­ ·çƾ ======



if($i>=4)

{

mysql_data_seek($result,$i);

$row=mysql_fetch_array($result);

$no=$row[no];

$name=$row[name];

$memo=$row[memo];

$email=$row[email];

$date=$row[4];









//==================== Ãâ·Â ·çƾ



$name = stripslashes($name);

$memo = stripslashes($memo);

echo "

";



// ================ NEW ¸¶Å© ÷°¡ =================



if($row[5] <= $newtime )

{

echo "
$memo $name ";



// ================ NEW ¸¶Å© ÷°¡ =================



if($row[5] <= $newtime )

{

echo "
$memo

$name
$date



");





//================== °Ë»ö °á°ú°¡ ÆäÀÌÁö ´ç Ãâ·Â¼ö º¸´Ù Å©¸é ===========



echo ("









");

if($total > $scale)



{



if( ($total+1)-($start+1) > $scale*$page_scale )

{ $pre_start= ($total-1)-($page-1)*$scale*$page_scale ;

echo("¢¸");

}







for($vj=0; $vj < $page_scale ; $vj++)

{



$ln = ($total-1)-(($page * $page_scale + $vj)*$scale) ;

$vk= $page * $page_scale + $vj+1 ;



if(0 < $ln && $ln < $total)

{



if($ln!=$start)

{

echo("[$vk]");

}

else

{

echo("$vk");



}



}



}







if($total > (($page+1)*$scale*$page_scale) )

{ $n_start=($total-1)-(($page+1)*$scale*$page_scale);

echo("¢º");

}



}

echo("
");



//============== 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)¿¡ ±¸ÇöÇØ

³õÀº°Ç ȸ¿øÀÎÁõ ·çƾÀ» Ãß°¡Çؼ­ ´Ù½Ã ¸¸µç °Ì´Ï´Ù.

°Å±â¿¡ Ä«¸á·¹¿Â È¿°ú(°Ô½ÃÆÇ¿¡ ±ÛÀÖ¾î¿ä)±îÁö ³ÖÀº °Ì´Ï´Ù.

ºñ±³ÇϽǶ§ Âü°íÇϽñæ...






³×ƼÁð ÀÇ°ß   ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.)
³»¿ë ¾ÆÀ̵ð ÀÇ°ß³²±â±â
°í¸¿½À´Ï´Ù. *¿Â¶óÀÎ ¸Þ¸ðÀå ¼­ºñ½º http://postsz.com
2012-03-18 20:19:05
seungangel
Âù¼º 21
¹Ý´ë 21
º¹Àâ!
2000-12-10 00:00:00
³ª
Âù¼º 51
¹Ý´ë 54
³Ê¹« º¹ÀâÇÔ
2000-12-09 00:00:00
»ç¶÷
Âù¼º 45
¹Ý´ë 43
1
À̸§
³»¿ë
:³×¸Â¾Æ¿ä: :È­³ª´Â±º¿ä: :Àá¿Í: :¿ì¿ïÇØ: :À̰ǾƳÄ: :¿ÕÇÏÇÏ: ¿Õ¿ôÀ½~ ³î·¥~
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
µµ¹è¹æÁöÅ°
 43122376 º¸ÀÌ´Â µµ¹è¹æÁöÅ°¸¦ ÀÔ·ÂÇϼ¼¿ä.