에러문 좀 봐주세요 ㅠㅠ 채택완료
<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>
</span></div><div><div><span style="font-size: 14.6667px; line-height: 22px;"><?php </span></div><div><span style="font-size: 14.6667px; line-height: 22px;">include_once('./_common.php');</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">function order_list_box($type,$limit,$subj,$sort,$sort2){</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> global $g5, $config, $member, $default ,$ca ,$it;</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">if(!$limit)</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$limit="";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">else </span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$limit="limit ".$limit;</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">if(!$sort2)</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$sort2="desc";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">else </span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$sort2="asc";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">if($sort){</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>$sort=$sort." ".$sort2;</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">}</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">else {</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>$sort="it_sum_qty ".$sort2;</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">}</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$where="";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">if($ca['ca_id']){<span class="Apple-tab-span" style="white-space:pre"> </span></span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$where="where ca_id=".$ca['ca_id']." or ca_id2=".$ca['ca_id']." or ca_id3=".$ca['ca_id'];</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">} </span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$it_id=$it['it_id'];</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$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}"; </span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$result=sql_query($sql);</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">//$category_list=array();</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> for ($i=0; $row=sql_fetch_array($result); $i++) {</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> <span class="Apple-tab-span" style="white-space:pre"> </span></span></div><div><span style="font-size: 14.6667px; line-height: 22px;">if($subj)</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> $name=cut_str($row['it_name'],$subj,"..");</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">else </span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>$name = $row['it_name'];</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> $row_class="";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> if($row['it_supply_subject']==""){</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">$row_class=" not_ready";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>}</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> if($type=="list"){ </span></div><div><span style="font-size: 14.6667px; line-height: 22px;">// $category_list[]=array("name"=>$row['it_name'],"img"=>G5_DATA_URL."/item/".$row['it_img1']); </span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> echo "<li class=\"item".$row_class."\" onclick=\"game_order(this,'".$row['it_id']."','".$row['it_name']."',".$i.");\">";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> echo "<div class=\"box\"><div class=\"thumbbox\">";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> if ($i == 5){ $text=" hide";}</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> echo "<img data-original=\"".G5_DATA_URL."/item/".$row['it_img1']."\" class=\"thumb".$text."\" /></div>";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<div class=\"infobox\"><p class=\"name\">".$name."</p><p class=\"type\">".$row['it_model']."</p>";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//echo "<p class=\"desc\">".conv_subject($row['it_explan'], 25, '..')."</p>";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>if($row['it_sum_qty'])</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> echo "<p class=\"buy_cnt\"><strong>".$row['it_sum_qty']."</strong>회 대리결제중</p>";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>echo "</div></div></li>";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> } else if($type=="txt"){</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> if($i==0)</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>echo $row['it_name'];</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> else </span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> echo ",".$row['it_name']; <span class="Apple-tab-span" style="white-space:pre"> </span> </span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> }else { </span></div><div><span style="font-size: 14.6667px; line-height: 22px;">// $category_list[]=array("name"=>$row['it_name'],"img"=>G5_DATA_URL."/item/".$row['it_img1']);</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> if(!$it['it_id']) {</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> 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>";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>}else {</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>$href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span> 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>";</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"><span class="Apple-tab-span" style="white-space:pre"> </span>}</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> }</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">
</span></div><div><span style="font-size: 14.6667px; line-height: 22px;"> }</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">//$category_list=json_encode($category_list);</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">}</span></div><div><span style="font-size: 14.6667px; line-height: 22px;">?></span></div></div><div><span style="font-size: 14.6667px; line-height: 22px;">
답변 1개
답변에 대한 댓글 3개
이런 형식이면 해당 값이 무조건 다 있어야 정상적으로 작동을 하는것이고
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개를 기본으로 가져옵니다.
$bo_id= explode("|",$od['od_memo'])[0]; 이와같이 배열을 바로 변수에 넣은것도 에러가발생되더라구요..흐미 ㅎㅎ
답변감사드립니다!
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
위 함수를 이렇게 바꾸니 오류문이 안뜨네요...
기본값이 없을 경우를 대비해서 위와같이 항상 false 값 또는 기본값을 지정을 해주어야하나요 ?