7.1 에서 7.4 로 PHP 올렸는데 잘 되는 부분이 안되네요.. ㅡ.ㅡ; 고견 부탁 드립니다.
본문
서버 업그레이드 차원에서 조금씩 선을 보고 있는데요. 7.1 에서 최근 올라온 7.4.9 PHP 에서 에러도 내지 않고 잘 되던 기능이 안되어서.. 시름 시름 시간만 보내고 있습니다.
혹시 보시고 고견을 부탁 드립니다.
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<script type="text/javascript">
<?php
$query = " select ca_id, bo_table from {$g5['board_category_table']} where bo_table = 'product' order by length(ca_id) desc limit 1 ";
$result = sql_query($query);
for ($k=0; $row=sql_fetch_array($result); $k++){
$category_len = strlen($row['ca_id']);
}
?>
$(function() {
<?php if(!$w == 'u' && !$sca1){?>
$("select[name=sca2]").prop("disabled", true);
$("select[name=sca3]").prop("disabled", true);
$("select[name=tag]").prop("disabled", true);
<?php }?>
<?php if(!$sca2){?>
$("select[name=sca3]").prop("disabled", true);
$("select[name=tag]").prop("disabled", true);
<?php }?>
$("select[name=sca1]").change(function() {
var category2 = $("select[name=sca2]");
var category3 = $("select[name=sca3]");
var ca_name = $(this).val();
category2.prop("disabled", false);
category2.children().remove();
category3.children().remove();
$(".sca1").addClass('active');
<?php
$query = " select ca_id, ca_name, bo_table from {$g5['board_category_table']} where bo_table = 'product' and length(ca_id) = '2' and ca_use = '0' order by ca_order ";
$result = sql_query($query);
for ($i=0; $row=sql_fetch_array($result); $i++){
?>
if(ca_name == '<?php echo $row['ca_id']?>'){
<?php
$query2 = " select ca_id, ca_name, bo_table from {$g5['board_category_table']} where bo_table = 'product' and LENGTH(ca_id) = '4' and SUBSTRING(ca_id,1,2) = '{$row[ca_id]}' and ca_use = '0' order by ca_order ";
$result2 = sql_query($query2);
for ($j=0; $cat2=sql_fetch_array($result2); $j++){
$id_cat2 = $cat2['ca_id'];
?>
category2.append('<option value= "<?php echo $cat2['ca_id']?>" ><?php echo $cat2['ca_name']?> </option>');
<?php }?>
}
<?php }?>
var category4 = $("select[name=tag]");
category4.prop("disabled", false);
category4.children().remove();
// 다운로드 버튼 비활성화
$('input[type=submit]').removeClass('active');
$('.sca4').removeClass('active');
// 1카테고리를 선택했는데 2카테고리가 존재하면 검색하지 않고 리턴
if ($('select[name=sca2]').children().length > 0) {
$('select[name=sca3]').prop("disabled", true);
$('select[name=tag]').prop("disabled", true);
return;
}
else {
$('select[name=sca2]').prop('disabled', true);
}
<?php
$query = " select ca_id, ca_name, bo_table from {$g5['board_category_table']} where bo_table = 'product' and LENGTH(ca_id) = '2' and ca_use = '0' order by ca_order ";
$result = sql_query($query);
for ($l=0; $row=sql_fetch_array($result); $l++){
?>
if(ca_name == '<?php echo $row['ca_id']?>'){
<?
$query2 = " select * from `g5_write_product` where bo_category1 = '{$row[ca_id]}' order by wr_subject ";
$result2 = sql_query($query2);
for ($j=0; $cat4=sql_fetch_array($result2); $l++){
?>
category4.append('<option value="<?php echo $cat4['wr_subject']?>" ><?php echo $cat4['wr_subject']?></option>');
<? }?>
}//ca_name2 end
<? }?>
});
<?php if($category_len >= "4"){?>
$("select[name=sca2]").change(function() {
var category3 = $("select[name=sca3]");
var ca_name2 = $(this).val();
category3.prop("disabled", false);
category3.children().remove();
$(".sca2").addClass('active');
<?php
$query = " select ca_id, ca_name, bo_table from {$g5['board_category_table']} where bo_table = 'product' and LENGTH(ca_id) = '4' and ca_use = '0' order by ca_order ";
$result = sql_query($query);
for ($k=0; $row=sql_fetch_array($result); $k++){
?>
if(ca_name2 == '<?php echo $row['ca_id']?>'){
<?
$query2 = " select ca_id, ca_name, bo_table from {$g5['board_category_table']} where bo_table = 'product' and LENGTH(ca_id) = '6' and SUBSTRING(ca_id,1,4) = '{$row['ca_id']}' and ca_use = '0' order by ca_order ";
$result2 = sql_query($query2);
for ($j=0; $cat3=sql_fetch_array($result2); $j++){
?>
category3.append('<option value="<?php echo $cat3['ca_id']?>" ><?php echo $cat3['ca_name']?></option>');
<? }?>
}//ca_name2 end
<? }?>
var category4 = $("select[name=tag]");
category4.prop("disabled", false);
category4.children().remove();
// 다운로드 버튼 비활성화
$('input[type=submit]').removeClass('active');
$('.sca4').removeClass('active');
// 2카테고리를 선택했는데 3카테고리가 존재하면 검색하지 않고 리턴
if ($('select[name=sca3]').children().length > 0) {
$('select[name=tag]').prop("disabled", true);
return;
}
else {
$('select[name=sca3]').prop("disabled", true);
}
<?php
$query = " select ca_id, ca_name, bo_table from {$g5['board_category_table']} where bo_table = 'product' and LENGTH(ca_id) = '4' and ca_use = '0' order by ca_order ";
$result = sql_query($query);
for ($l=0; $row=sql_fetch_array($result); $l++){
?>
if(ca_name2 == '<?php echo $row['ca_id']?>'){
<?
$query2 = " select * from `g5_write_product` where bo_category2 = '{$row['ca_id']}' order by wr_subject ";
$result2 = sql_query($query2);
for ($j=0; $cat4=sql_fetch_array($result2); $l++){
?>
category4.append('<option value="<?php echo $cat4['wr_subject']?>" ><?php echo $cat4['wr_subject']?></option>');
<? }?>
}//ca_name2 end
<? }?>
});
<?php }?>
$("select[name=sca3]").change(function() {
var category4 = $("select[name=tag]");
var ca_name3 = $(this).val();
category4.prop("disabled", false);
category4.children().remove();
$(".sca3").addClass('active');
// 다운로드 버튼 비활성화
$('input[type=submit]').removeClass('active');
$('.sca4').addClass('active');
<?php
$query = " select ca_id, ca_name, bo_table from {$g5['board_category_table']} where bo_table = 'product' and LENGTH(ca_id) = '6' and ca_use = '0' order by ca_order ";
$result = sql_query($query);
for ($l=0; $row=sql_fetch_array($result); $l++){
?>
if(ca_name3 == '<?php echo $row['ca_id']?>'){
<?php
$query2 = " select * from `g5_write_product` where bo_category3 = '{$row['ca_id']}' order by wr_subject ";
$result2 = sql_query($query2);
for ($j=0; $cat4=sql_fetch_array($result2); $l++){
?>
category4.append('<option value="<?php echo $cat4['wr_subject']?>" ><?php echo $cat4['wr_subject']?></option>');
<?php }?>
}//ca_name2 end
<?php }?>
// 3카테고리를 선택했는데 4카테고리가 존재하지 않으면 비활성화
if ($('select[name=tag]').children().length == 0) {
$('select[name=tag]').prop("disabled", true);
}
});
$("select[name=tag]").change(function() {
var submit = $("input[type=submit]");
submit.addClass('active');
$(".sca4").addClass('active');
});
});
</script>
답변 2
어느부분인지 체크하기가 어렵습니다.
https://www.php.net/manual/en/migration72.php 를 보시고, 순서대로 차근 차근 올려 보세요.
없어진 기능 체크해 가면서..
그리고 중간 중간에 메시지 찍어가면서 확인해 보는 방법도 있습니다.
오류를 올려보세요.
답변을 작성하시기 전에 로그인 해주세요.