제로보드 설문조사 결과가 이상합니다.ㅡㅡ;
-
게시물 수정 , 삭제는 로그인 필요
제로보드 설문조사가 결과가 이상합니다..
위, 아래 순서가 바뀌어서 적용됩니다.. ㅡㅡ;
아래 주소 보시면.. 예를 들어
처음 화면에서 맨 위 "로즈레드"를 선택하고 투표하기 하면
결과 화면에서 맨 아래 "컨티넨탈 실버" 값이 올라갑니다.
즉 위 아래 순서가 바뀌어서 적용됩니다.
고수님들 도와주세요.. ㅜㅜ
주소 : www.newavante.com
vote.php 소스
<?
//---------------------------------------------------
$filename=realpath(__FILE__);
$config_dir=eregi_replace("vote.php","",$filename);
require "$config_dir"."dbconn.php";
$id = "ke_vote"; //게시판이름
$title_leg = "100"; //설문조사 제목 길이
$log_image = "http://www.newavante.com/vote/img"; //이미지 경로
$connect = mysql_connect($host_name,$user_name,$db_password);
mysql_select_db($db_name);
echo"<STYLE TYPE='text/css'>
A:link {color: 666666; text-decoration: none;}
A:visited {color: 666666; text-decoration: none;}
A:hover {color:666666; text-decoration: none;}
BODY,TABLE,TR,TD,table{font-size:9pt; color: 444444; font-family:굴림체;}
BODY
</style>
<script>
function check_survey_submit()
{
var check=0;
for(i=0;i<main_survey.sub_no.length;i++)
{
if(main_survey.sub_no[i].checked) {check=1;}
}
if(check<1) {alert('투표할 메뉴를 선택하세요)'); return false;}
return true;
}
</script>
<table align=center border=0 cellpadding=0 cellspacing=0 width=250>
<tr>
<td width=250 colspan=3></td>
</tr>
<tr>
<td width=250>
<table align=center border=0 cellpadding=0 cellspacing=0 background=''>";
$result=mysql_query("select * from zetyx_board_$id where prev_no=0 order by arrangenum asc") or die(mysql_error());
for($i=0; $i < $data=mysql_fetch_array($result); $i++)
{
//제목 자르기
$title_cut="$data[subject]";
$title_leg2=strlen($title_cut);
for($k=0; $k<$title_leg-1; $k++)
{
if(ord(substr($title_cut, $k, 1))>127) $k++;
}
if ($title_leg2 > $title_leg)
{
$title_cutt=substr($title_cut, 0, $k)."...";
}
else { //자른 값보다 작으면 원래대로
$title_cutt=$title_cut;
}
if($i==0)
{
$no=$data[no];
echo "
<tr>
<td width=250><p style=line-height:150%; margin-top:0; margin-bottom:0;> $title_cutt</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
";
echo "<form method=post action=$zero_path/"."apply_vote.php name=main_survey onsubmit='return check_survey_submit()' target=_parent>
<input type=hidden name=id value=$id>
<input type=hidden name=no value=$no>";
}else{
$sub_no=$no+$i; //위에서 정해준 no에 현재 i의 값을 더해서 sub_no에 넣어줌.
echo "
<tr>
<td width=250><input type=radio name=sub_no value=$sub_no onfocus=blur()> $title_cutt </td>
</tr>
<tr>
<td colspan=2></td>
</tr>";
}
}//for문
echo "
</table>
</td>
</tr>
<tr>
<td width=250>
<table align=center width=250 bgcolor='#F3F3F3' >
<tr>
<td colspan=2 ><p align=center>
<input type='image' style='cursor:hand' src=$log_image/"."vote1.gif onfocus=blur() target=_parent> <a href=$zero_path/"."view.php?id=$id&no=$no style='cursor:hand' onfocus=blur() target=_parent><img src=$log_image/"."vote2.gif border=0></a>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>";
mysql_close();
?>
제로보드 설문조사가 결과가 이상합니다..
위, 아래 순서가 바뀌어서 적용됩니다.. ㅡㅡ;
아래 주소 보시면.. 예를 들어
처음 화면에서 맨 위 "로즈레드"를 선택하고 투표하기 하면
결과 화면에서 맨 아래 "컨티넨탈 실버" 값이 올라갑니다.
즉 위 아래 순서가 바뀌어서 적용됩니다.
고수님들 도와주세요.. ㅜㅜ
주소 : www.newavante.com
vote.php 소스
<?
//---------------------------------------------------
$filename=realpath(__FILE__);
$config_dir=eregi_replace("vote.php","",$filename);
require "$config_dir"."dbconn.php";
$id = "ke_vote"; //게시판이름
$title_leg = "100"; //설문조사 제목 길이
$log_image = "http://www.newavante.com/vote/img"; //이미지 경로
$connect = mysql_connect($host_name,$user_name,$db_password);
mysql_select_db($db_name);
echo"<STYLE TYPE='text/css'>
A:link {color: 666666; text-decoration: none;}
A:visited {color: 666666; text-decoration: none;}
A:hover {color:666666; text-decoration: none;}
BODY,TABLE,TR,TD,table{font-size:9pt; color: 444444; font-family:굴림체;}
BODY
</style>
<script>
function check_survey_submit()
{
var check=0;
for(i=0;i<main_survey.sub_no.length;i++)
{
if(main_survey.sub_no[i].checked) {check=1;}
}
if(check<1) {alert('투표할 메뉴를 선택하세요)'); return false;}
return true;
}
</script>
<table align=center border=0 cellpadding=0 cellspacing=0 width=250>
<tr>
<td width=250 colspan=3></td>
</tr>
<tr>
<td width=250>
<table align=center border=0 cellpadding=0 cellspacing=0 background=''>";
$result=mysql_query("select * from zetyx_board_$id where prev_no=0 order by arrangenum asc") or die(mysql_error());
for($i=0; $i < $data=mysql_fetch_array($result); $i++)
{
//제목 자르기
$title_cut="$data[subject]";
$title_leg2=strlen($title_cut);
for($k=0; $k<$title_leg-1; $k++)
{
if(ord(substr($title_cut, $k, 1))>127) $k++;
}
if ($title_leg2 > $title_leg)
{
$title_cutt=substr($title_cut, 0, $k)."...";
}
else { //자른 값보다 작으면 원래대로
$title_cutt=$title_cut;
}
if($i==0)
{
$no=$data[no];
echo "
<tr>
<td width=250><p style=line-height:150%; margin-top:0; margin-bottom:0;> $title_cutt</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
";
echo "<form method=post action=$zero_path/"."apply_vote.php name=main_survey onsubmit='return check_survey_submit()' target=_parent>
<input type=hidden name=id value=$id>
<input type=hidden name=no value=$no>";
}else{
$sub_no=$no+$i; //위에서 정해준 no에 현재 i의 값을 더해서 sub_no에 넣어줌.
echo "
<tr>
<td width=250><input type=radio name=sub_no value=$sub_no onfocus=blur()> $title_cutt </td>
</tr>
<tr>
<td colspan=2></td>
</tr>";
}
}//for문
echo "
</table>
</td>
</tr>
<tr>
<td width=250>
<table align=center width=250 bgcolor='#F3F3F3' >
<tr>
<td colspan=2 ><p align=center>
<input type='image' style='cursor:hand' src=$log_image/"."vote1.gif onfocus=blur() target=_parent> <a href=$zero_path/"."view.php?id=$id&no=$no style='cursor:hand' onfocus=blur() target=_parent><img src=$log_image/"."vote2.gif border=0></a>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>";
mysql_close();
?>
#제로보드 설문조사