ITmembers.net 아카이브 · 2002–2009

질문과 답변

한줄메모장..ㅋㅋ

안녕하세요.. 또 들렀네요.. 무슨 저희집같이 너무 마니오네요.. 민망하기도 하구 ㅋㅋ
님 덕분에 강좌게시판만들라고했는데 거의
완성해서 기분이 좋네요 감사합니다...
이번에는 좀 다른 질문인데ㅛ..감이 안잡혀서..ㅋㅋ
간단한 메모장을
아래소스는 그냥 메모장을 조금 바꿨어요...
총게시물하고... 어쩌구저쩌구 님의 강좌랑 비슷..

새글일때... 표시도되구요 아무튼.. 상단
라디오버튼체크를 하고.. 이름하고 글을 ㅆ면..
선택된이미지가 보여지게하고싶어서 하는데
잘  안되네요.. 감이 안오네요..
머.. 라디오 버튼은 해놓았지만.. 링크 건곳은
보여지게 할라고 일부러 그렇게한거구요..
값을 어떻게 하는지 모르겠네요...
$slt로 해서 보여지는 부분에 해당값을
$slt로 보여지게할라하는데 밑에는 $select_1
이미지를 바로보여주게해놓았는데요...
임시방편 ㅋㅋㅋ 답변부탁드리겠습니다..
무슨말인지 저도 잘모르겠네요 ㅋㅋ
http://www.leejinsoo.net/js_bbs/skin/js_memo/list.php




<html>
<head>
   <title>『 L E E J I N S O O .net 』 ™</title>
   <meta http-equiv=Content-Type content=text/html;>
   <link rel=StyleSheet HREF='style.css' type='text/css'>
<body bgcolor="#505050">
<form method=post action=write.php>
<table border=0 ecllspacing=0 width=100%>
<tr>
<td width=20%><input type=radio name=select_1 value=a checked>대한민국!
              <input type=radio name=select_2 value=b >붉은악마!        
<td width=70%><font color="#999999">이름 <input type=text name=name size=10 maxlength=10  class=input2> 
              한줄입력 <input type=text name=memo size=60 maxlength=20  class=input2></font></td>
<td width=10%><input type=image src='./images/kor_memo_ok.gif' border=0></td>

</tr>
</table>
</form>

<?
include"connect.php";//DB에 접속

$query="select count(*) from exam_memo"; //쿼리문저장
$total=mysql_fetch_array(mysql_query($query)); //쿼리문입력
$total=$total["count(*)"]; //갯수저장

$page=5; //페이지당 갯수
$pagesu=ceil($total/$page); //페이지수를 구합니다. 결과:4
$start=($page*$pagenum); //가져올 시작위치를 결정합니다.

$select_1="<img src='./images/kor_memo_fighting_1.gif' border='0'>";
$select_2="<img src='./images/kor_memo_fighting_2.gif' border='0'>";

if($select_1 == a){
$slt="$select_1";
}else{
$slt="select_2";
}

//테이블시작
echo"";

$query="select * from exam_memo order by no desc limit $start,$page"; //꺼내올 쿼리문
$result=mysql_query($query,$connect); //mysql에 요청

while($array=mysql_fetch_array($result)) //결과를 꺼내옴
{
$data[date]=date('y-m-d',$array[date]);//시간가공
$data[name]=stripslashes($array[name]);//이름에서 제거
$data[memo]=stripslashes($array[memo]);//메모에서 제거

//새글일 경우

$new=(time()-$array[date])/60/60; //작성된 글이 24시간안에 작성된글인 경우
if($new<24) {
$bbs_new= "<img src='./images/bbs_new_3.gif'>";
}else {
$bbs_new= "<img src='./images/bbs_old.gif'>";
}

echo "
<table width=100% background=./images/kor_memo_bak.gif>
          <tr><td width=5% height=27>$bbs_new</td>
          <td width=10% height=27>$select_1</td>         
          <td width=65% height=27>$data[memo]</td>
          <td width=20% height=27><font color='#609060'>| $data[name]</font></td></tr></table> ";//꺼내온것출력
}



echo "
<table border=0 ecllspacing=0 width=100%>
<tr><td colspan=4 height=27 align=center>";

$pageviewsu=10; //한페이지에 보여질 목록수
$pagegroup=ceil(($pagenum+1)/$pageviewsu); //페이지 그룹결정
$pagestart=($pageviewsu*($pagegroup-1))+1; //시작페이지결정
$pageend=$pagestart+$pageviewsu-1; //종료페이지결정

if($pagegroup>1){
$prev=$pagestart-$pageviewsu-1;//이전목록그룹의 시작페이지결정
echo"<a href=list.php?pagenum=$prev>◀◀ </a> ";
}



for($i=$pagestart;$i<=$pageend;$i++)
{
if($pagesu<$i){break;}
$j=$i-1;
if($j==$pagenum){echo "<font color='#609060'>$i </font> ";}
else{echo "<a href=list.php?pagenum=$j>$i </a> ";}
}



if($pageend<$pagesu){echo"<a href=list.php?pagenum=$pageend>▶▶ </a> ";}


echo"</td></tr></table>";//테이블끝

?>

댓글 1