채택완료

에러문 좀 봐주세요 ㅠㅠ

<br>

<b>Warning</b>:  Missing argument 3 for order_list_box(), called in /home/hosting_users/test/www/order/order.php on line 19 and defined in <b>/home/hosting_users/test/www/order/list.php</b> on line <b>3</b><br>

<br>

<b>Warning</b>:  Missing argument 4 for order_list_box(), called in /home/hosting_users/test/www/order/order.php on line 19 and defined in <b>/home/hosting_users/test/www/order/list.php</b> on line <b>3</b><br>

<br>

<b>Warning</b>:  Missing argument 5 for order_list_box(), called in /home/hosting_users/test/www/order/order.php on line 19 and defined in <b>/home/hosting_users/test/www/order/list.php</b> on line <b>3</b><br>


위와 같이 에러가 연속으로 뜨는데...왜그런가요..
order_list_box 함수의 내용을 지워도 위와 같은 에러가 발생되요..

그런데 오류 메시지는 출력되지만, 실제 함수역시 작동이 되거든요....
불러오는 함수는  <?php order_list_box("list",8);?>
이렇게 불러오고잇거든요..
이거자체가 오류인가요!?
php5.5


아래는.. order_list_box 실제 함수입니다..좀 너저분해요...
Copy
<?php include_once('./_common.php');function order_list_box($type,$limit,$subj,$sort,$sort2){  global $g5, $config, $member, $default ,$ca ,$it;if(!$limit)$limit="";else $limit="limit ".$limit;if(!$sort2)$sort2="desc";else $sort2="asc";if($sort){	$sort=$sort." ".$sort2;}else {	$sort="it_sum_qty ".$sort2;}$where="";if($ca['ca_id']){	$where="where ca_id=".$ca['ca_id']." or ca_id2=".$ca['ca_id']." or ca_id3=".$ca['ca_id'];} $it_id=$it['it_id'];$sql = "select it_id,it_name,it_explan,it_img1,it_supply_subject,it_model,it_sum_qty,ca_id from {$g5['g5_shop_item_table']} {$where} order by {$sort} {$limit}"; $result=sql_query($sql);//$category_list=array(); for ($i=0; $row=sql_fetch_array($result); $i++) { 	if($subj)		 $name=cut_str($row['it_name'],$subj,"..");else 	$name = $row['it_name']; $row_class="";   if($row['it_supply_subject']==""){$row_class=" not_ready";	} if($type=="list"){ // $category_list[]=array("name"=>$row['it_name'],"img"=>G5_DATA_URL."/item/".$row['it_img1']);      echo "<li class=\"item".$row_class."\"  onclick=\"game_order(this,'".$row['it_id']."','".$row['it_name']."',".$i.");\">";     echo "<div class=\"box\"><div class=\"thumbbox\">";	 if ($i == 5){ $text=" hide";}	 echo "<img data-original=\"".G5_DATA_URL."/item/".$row['it_img1']."\" class=\"thumb".$text."\" /></div>";		echo "<div class=\"infobox\"><p class=\"name\">".$name."</p><p class=\"type\">".$row['it_model']."</p>";		//echo "<p class=\"desc\">".conv_subject($row['it_explan'], 25, '..')."</p>";		if($row['it_sum_qty'])		   echo "<p class=\"buy_cnt\"><strong>".$row['it_sum_qty']."</strong>회  대리결제중</p>";		echo "</div></div></li>"; } else if($type=="txt"){	  if($i==0)		echo $row['it_name'];		  else 	     echo ",".$row['it_name'];  	  }else { // $category_list[]=array("name"=>$row['it_name'],"img"=>G5_DATA_URL."/item/".$row['it_img1']);    if(!$it['it_id']) {     echo "<li class=\"item".$row_class."\" onclick=\"search_game_action('".$row['it_name']."',true,true);\"><div class=\"box\"><div class=\"thumbbox\">".get_it_image($row['it_id'],30,30)."</div><div class=\"infobox\"><p class=\"name\">".$name."</p><p class=\"type\">".$row['it_model']."</p><p class=\"desc\">".conv_subject($row['it_explan'], 25, '..')."</p></div></div></li>";	}else {		$href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];		 echo "<li class=\"item".$row_class."\"><a href=\"".$href."\"><div class=\"box\"><div class=\"thumbbox\">".get_it_image($row['it_id'],30,30)."</div><div class=\"infobox\"><p class=\"name\">".$name."</p><p class=\"type\">".$row['it_model']."</p><p class=\"desc\">".conv_subject($row['it_explan'], 25, '..')."</p></div></div></a></li>";	} } }//$category_list=json_encode($category_list);}?>

|

답변 1개 / 댓글 3개

채택된 답변
+20 포인트

인자값을 두개만 받는게 맞는지 order_list_box함수를 살펴 봐야 알것 같아요.

해당 함수 상단 몇줄만 보여주세요

답변에 대한 댓글 3개

function order_list_box($type,$limit=false,$subj=false,$sort=false,$sort2=false){
위 함수를 이렇게 바꾸니 오류문이 안뜨네요...
기본값이 없을 경우를 대비해서 위와같이 항상 false 값 또는 기본값을 지정을 해주어야하나요 ?
기존 function order_list_box($type,$limit,$subj,$sort,$sort2){
이런 형식이면 해당 값이 무조건 다 있어야 정상적으로 작동을 하는것이고
function order_list_box($type,$limit=10,$subj=.... 이런형식으로 하셔야지
값을 입력을 안해도 기본값으로 해당 값을 인지합니다.
지금 함수에는 기본값을 limit 에 10을 넣었는데 (ex : function order_list_box($type,$limit=10,$subj=.... )
만약에 <?php order_list_box("list",8);?> 이렇게 쓰시면 8개만 뽑아오지만
<?php order_list_box("list");?> 이렇게 쓰시면 10개를 기본으로 가져옵니다.
그렇군요 ㅠㅠ.. php7에서 오류가 좀 발생되어, php5 로 내리니까 , 어마어마하게 에러가 발생되네요 ㅎㅎ 그동안 너무 ... 대충아는 지식으로 한거같아요..
$bo_id= explode("|",$od['od_memo'])[0]; 이와같이 배열을 바로 변수에 넣은것도 에러가발생되더라구요..흐미 ㅎㅎ

답변감사드립니다!

답변을 작성하려면 로그인이 필요합니다.