<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>해피정닷컴 &amp;gt; 해피정닷컴 &amp;gt; 기술자료</title>
<link>https://www.happyjung.com/lecture</link>
<description>테스트 버전 0.2 (2004-04-26)</description>
<language>ko</language>


<item>
<title>상품 복사할때 조회수 제외하기</title>
<link>https://www.happyjung.com/lecture/3338</link>
<description><![CDATA[영카트 상품을 복사해서 등록 하는 경우, 조회수까지 복사되지 않도록 하는 방법 입니다.<br />
영카트 지금까지 이용하면서, 상품 복사 기능을 많이 이용하죠.<br />
새로 상품 등록하면서 비슷한 상품을 복사해서 등록하게 되는데, 이때 상품의 내용과 더불어 조회수까지 복사됩니다.<br />
새 상품을 등록했음에도 불구하고 조회수가 0 이 아닌 복사에 사용된 상품의 조회수까지 복사되는 문제(?)가 있더라구요.<br />
<br />
SIR 에 이 상황을 알렸으나, 영카트 처음부터 지금까지 그렇게 적용했었기 때문에 수정은 없다라고 하네요.<br />
아래와 같이 간단하게 코드를 추가하면 조회수는 복사에서 제외할 수 있습니다.<br />
<br />
<br />
/adm/shop_admin/itemcopyupdate.php &nbsp;에서<br />
<br />
수정전<br />
foreach($fields as $fld) {<br />
&nbsp; &nbsp; if ($fld == &#39;it_id&#39; || $fld == &#39;it_sum_qty&#39; || $fld == &#39;it_use_cnt&#39; || $fld == &#39;it_use_avg&#39;)<br />
<br />
<br />
수정후<br />
foreach($fields as $fld) {<br />
&nbsp; &nbsp; if ($fld == &#39;it_id&#39; || $fld == &#39;it_sum_qty&#39; || $fld == &#39;it_use_cnt&#39; || $fld == &#39;it_use_avg&#39;<strong><span style="color:#ff0000;"> || $fld == &#39;it_hit&#39;</span></strong>)]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Sun, 22 Mar 2026 22:26:32 +0900</dc:date>
</item>


<item>
<title>영카트5 관리자 상품관리 에서 카테고리 정렬 오류</title>
<link>https://www.happyjung.com/lecture/3337</link>
<description><![CDATA[영카트 관리자페이지에서 상품관리에서 카테고리 1차 2차 등의 순서가 올바르지 않게 나오는 현상 해결하기<br />
<br />
<br />
<span style="font-size:18px;"><strong>1.</strong></span>&nbsp;/lib/shop.lib.php 내용 추가<br />
<br />
// 분류 옵션 생성<br />
function make_shop_category_options($parent_ca_id = &#39;&#39;, $depth = 0)<br />
{<br />
&nbsp; &nbsp; global $g5, $is_admin, $member;<br />
<br />
&nbsp; &nbsp; $sql = &quot; select ca_id, ca_name, ca_order<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from {$g5[&#39;g5_shop_category_table&#39;]}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where 1 &quot;;<br />
<br />
&nbsp; &nbsp; if ($is_admin != &#39;super&#39;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and ca_mb_id = &#39;&quot;.sql_real_escape_string($member[&#39;mb_id&#39;]).&quot;&#39; &quot;;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; if ($parent_ca_id == &#39;&#39;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 1차 분류만<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and length(ca_id) = 2 &quot;;<br />
&nbsp; &nbsp; } else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 현재 부모의 바로 아래 자식만<br />
&nbsp; &nbsp; &nbsp; &nbsp; $child_len = strlen($parent_ca_id) + 2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and ca_id like &#39;&quot;.sql_real_escape_string($parent_ca_id).&quot;%&#39; &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and length(ca_id) = &#39;{$child_len}&#39; &quot;;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; $sql .= &quot; order by ca_order, ca_id &quot;;<br />
<br />
&nbsp; &nbsp; $result = sql_query($sql);<br />
&nbsp; &nbsp; $html = &#39;&#39;;<br />
<br />
&nbsp; &nbsp; while ($row = sql_fetch_array($result)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $nbsp = str_repeat(&#39; &nbsp; &#39;, $depth);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $html .= &#39;&lt;option value=&quot;&#39;.$row[&#39;ca_id&#39;].&#39;&quot;&gt;&#39;.$nbsp.get_text($row[&#39;ca_name&#39;]).&#39;&lt;/option&gt;&#39;.PHP_EOL;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 현재 분류의 하위 분류 이어서 출력<br />
&nbsp; &nbsp; &nbsp; &nbsp; $html .= make_shop_category_options($row[&#39;ca_id&#39;], $depth + 1);<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; return $html;<br />
}<br />
<br />
function make_shop_category_options_selected($selected_ca_id = &#39;&#39;, $parent_ca_id = &#39;&#39;, $depth = 0)<br />
{<br />
&nbsp; &nbsp; global $g5, $is_admin, $member;<br />
<br />
&nbsp; &nbsp; $sql = &quot; select ca_id, ca_name, ca_order<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from {$g5[&#39;g5_shop_category_table&#39;]}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where 1 &quot;;<br />
<br />
&nbsp; &nbsp; if ($is_admin != &#39;super&#39;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and ca_mb_id = &#39;&quot;.sql_real_escape_string($member[&#39;mb_id&#39;]).&quot;&#39; &quot;;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; if ($parent_ca_id == &#39;&#39;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and length(ca_id) = 2 &quot;;<br />
&nbsp; &nbsp; } else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $child_len = strlen($parent_ca_id) + 2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and ca_id like &#39;&quot;.sql_real_escape_string($parent_ca_id).&quot;%&#39; &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; and length(ca_id) = &#39;{$child_len}&#39; &quot;;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; $sql .= &quot; order by ca_order, ca_id &quot;;<br />
<br />
&nbsp; &nbsp; $result = sql_query($sql);<br />
&nbsp; &nbsp; $html = &#39;&#39;;<br />
<br />
&nbsp; &nbsp; while ($row = sql_fetch_array($result)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $nbsp = str_repeat(&#39; &nbsp; &#39;, $depth);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $selected = get_selected($selected_ca_id, $row[&#39;ca_id&#39;]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $html .= &#39;&lt;option value=&quot;&#39;.$row[&#39;ca_id&#39;].&#39;&quot; &#39;.$selected.&#39;&gt;&#39;.$nbsp.get_text($row[&#39;ca_name&#39;]).&#39;&lt;/option&gt;&#39;.PHP_EOL;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $html .= make_shop_category_options_selected($selected_ca_id, $row[&#39;ca_id&#39;], $depth + 1);<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; return $html;<br />
}<br />
<br />
<br />
<br />
<br />
<span style="font-size:18px;"><strong>2.</strong></span> /adm/shop_admin/itemlist.php<br />
&lt;&lt;&lt;&lt;&nbsp;변경전 &gt;&gt;&gt;&gt;<br />
// 분류<br />
$ca_list &nbsp;= &#39;&lt;option value=&quot;&quot;&gt;선택&lt;/option&gt;&#39;.PHP_EOL;<br />
$sql = &quot; select * from {$g5[&#39;g5_shop_category_table&#39;]} &quot;;<br />
if ($is_admin != &#39;super&#39;)<br />
&nbsp; &nbsp; $sql .= &quot; where ca_mb_id = &#39;{$member[&#39;mb_id&#39;]}&#39; &quot;;<br />
$sql .= &quot; order by ca_order, ca_id &quot;;<br />
$result = sql_query($sql);<br />
for ($i=0; $row=sql_fetch_array($result); $i++)<br />
{<br />
&nbsp; &nbsp; $len = strlen($row[&#39;ca_id&#39;]) / 2 - 1;<br />
&nbsp; &nbsp; $nbsp = &#39;&#39;;<br />
&nbsp; &nbsp; for ($i=0; $i&lt;$len; $i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $nbsp .= &#39; &nbsp; &#39;;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; $ca_list .= &#39;&lt;option value=&quot;&#39;.$row[&#39;ca_id&#39;].&#39;&quot;&gt;&#39;.$nbsp.$row[&#39;ca_name&#39;].&#39;&lt;/option&gt;&#39;.PHP_EOL;<br />
}<br />
<br />
&lt;&lt;&lt;&lt; 변경후 &gt;&gt;&gt;&gt;<br />
// 분류<br />
// lib/shop.lib.php&nbsp;<br />
// function make_shop_category_options($parent_ca_id = &#39;&#39;, $depth = 0)<br />
$ca_list &nbsp;= &#39;&lt;option value=&quot;&quot;&gt;선택&lt;/option&gt;&#39;.PHP_EOL;<br />
$ca_list .= make_shop_category_options();<br />
/*$ca_list &nbsp;= &#39;&lt;option value=&quot;&quot;&gt;선택&lt;/option&gt;&#39;.PHP_EOL;<br />
$sql = &quot; select * from {$g5[&#39;g5_shop_category_table&#39;]} &quot;;<br />
if ($is_admin != &#39;super&#39;)<br />
&nbsp; &nbsp; $sql .= &quot; where ca_mb_id = &#39;{$member[&#39;mb_id&#39;]}&#39; &quot;;<br />
$sql .= &quot; order by ca_order, ca_id &quot;;<br />
$result = sql_query($sql);<br />
for ($i=0; $row=sql_fetch_array($result); $i++)<br />
{<br />
&nbsp; &nbsp; $len = strlen($row[&#39;ca_id&#39;]) / 2 - 1;<br />
&nbsp; &nbsp; $nbsp = &#39;&#39;;<br />
&nbsp; &nbsp; for ($i=0; $i&lt;$len; $i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $nbsp .= &#39; &nbsp; &#39;;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; $ca_list .= &#39;&lt;option value=&quot;&#39;.$row[&#39;ca_id&#39;].&#39;&quot;&gt;&#39;.$nbsp.$row[&#39;ca_name&#39;].&#39;&lt;/option&gt;&#39;.PHP_EOL;<br />
}*/<br />
<br />
<br />
<br />
<strong><span style="font-size:18px;">3.</span></strong> /adm/shop_admin/itemlist.php<br />
&lt;&lt;&lt;&lt;&nbsp;변경전 &gt;&gt;&gt;&gt;<br />
&lt;select name=&quot;sca&quot; id=&quot;sca&quot;&gt;<br />
&nbsp; &nbsp; &lt;option value=&quot;&quot;&gt;전체분류&lt;/option&gt;<br />
&nbsp; &nbsp; &lt;?php<br />
&nbsp; &nbsp; $sql1 = &quot; select ca_id, ca_name from {$g5[&#39;g5_shop_category_table&#39;]} order by ca_order, ca_id &quot;;<br />
&nbsp; &nbsp; $result1 = sql_query($sql1);<br />
&nbsp; &nbsp; for ($i=0; $row1=sql_fetch_array($result1); $i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $len = strlen($row1[&#39;ca_id&#39;]) / 2 - 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $nbsp = &#39;&#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $i&lt;$len; $i++) $nbsp .= &#39; &nbsp; &#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &#39;&lt;option value=&quot;&#39;.$row1[&#39;ca_id&#39;].&#39;&quot; &#39;.get_selected($sca, $row1[&#39;ca_id&#39;]).&#39;&gt;&#39;.$nbsp.$row1[&#39;ca_name&#39;].&#39;&lt;/option&gt;&#39;.PHP_EOL;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; ?&gt;<br />
&lt;/select&gt;<br />
<br />
<br />
&lt;&lt;&lt;&lt; 변경후 &gt;&gt;&gt;&gt;<br />
&lt;select name=&quot;sca&quot; id=&quot;sca&quot;&gt;<br />
&nbsp; &nbsp; &lt;option value=&quot;&quot;&gt;전체분류&lt;/option&gt;<br />
&nbsp; &nbsp; &lt;?php<br />
&nbsp; &nbsp; // lib/shop.lib.php&nbsp;<br />
&nbsp; &nbsp; // function make_shop_category_options_selected($selected_ca_id = &#39;&#39;, $parent_ca_id = &#39;&#39;, $depth = 0)<br />
&nbsp; &nbsp; /*<br />
&nbsp; &nbsp; $sql1 = &quot; select ca_id, ca_name from {$g5[&#39;g5_shop_category_table&#39;]} order by ca_order, ca_id &quot;;<br />
&nbsp; &nbsp; $result1 = sql_query($sql1);<br />
&nbsp; &nbsp; for ($i=0; $row1=sql_fetch_array($result1); $i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $len = strlen($row1[&#39;ca_id&#39;]) / 2 - 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $nbsp = &#39;&#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $i&lt;$len; $i++) $nbsp .= &#39; &nbsp; &#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &#39;&lt;option value=&quot;&#39;.$row1[&#39;ca_id&#39;].&#39;&quot; &#39;.get_selected($sca, $row1[&#39;ca_id&#39;]).&#39;&gt;&#39;.$nbsp.$row1[&#39;ca_name&#39;].&#39;&lt;/option&gt;&#39;.PHP_EOL;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; */<br />
&nbsp; &nbsp; echo make_shop_category_options_selected($sca);&nbsp;<br />
&nbsp; &nbsp; ?&gt;<br />
&lt;/select&gt;<br />
<br />
<br />
<br />
<strong><span style="font-size:18px;">4-1.</span></strong> /adm/shop_admin/itemform.php<br />
&lt;&lt;&lt;&lt;&nbsp;변경전 &gt;&gt;&gt;&gt;<br />
// 분류리스트<br />
$category_select = &#39;&#39;;<br />
$script = &#39;&#39;;<br />
$sql = &quot; select * from {$g5[&#39;g5_shop_category_table&#39;]} &quot;;<br />
if ($is_admin != &#39;super&#39;)<br />
&nbsp; &nbsp; $sql .= &quot; where ca_mb_id = &#39;{$member[&#39;mb_id&#39;]}&#39; &quot;;<br />
$sql .= &quot; order by ca_order, ca_id &quot;;<br />
$result = sql_query($sql);<br />
for ($i=0; $row=sql_fetch_array($result); $i++)<br />
{<br />
&nbsp; &nbsp; $len = strlen($row[&#39;ca_id&#39;]) / 2 - 1;<br />
<br />
&nbsp; &nbsp; $nbsp = &quot;&quot;;<br />
&nbsp; &nbsp; for ($i=0; $i&lt;$len; $i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; $nbsp .= &quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;;<br />
<br />
&nbsp; &nbsp; $category_select .= &quot;&lt;option value=\&quot;{$row[&#39;ca_id&#39;]}\&quot;&gt;$nbsp{$row[&#39;ca_name&#39;]}&lt;/option&gt;\n&quot;;<br />
<br />
&nbsp; &nbsp; $script .= &quot;ca_use[&#39;{$row[&#39;ca_id&#39;]}&#39;] = {$row[&#39;ca_use&#39;]};\n&quot;;<br />
&nbsp; &nbsp; $script .= &quot;ca_stock_qty[&#39;{$row[&#39;ca_id&#39;]}&#39;] = {$row[&#39;ca_stock_qty&#39;]};\n&quot;;<br />
&nbsp; &nbsp; //$script .= &quot;ca_explan_html[&#39;$row[ca_id]&#39;] = $row[ca_explan_html];\n&quot;;<br />
&nbsp; &nbsp; $script .= &quot;ca_sell_email[&#39;{$row[&#39;ca_id&#39;]}&#39;] = &#39;{$row[&#39;ca_sell_email&#39;]}&#39;;\n&quot;;<br />
}<br />
<br />
<br />
&lt;&lt;&lt;&lt; &nbsp;변경후 &gt;&gt;&gt;&gt;<br />
// 분류리스트<br />
$category_select = make_shop_category_options();<br />
$script = &#39;&#39;;<br />
<br />
$sql = &quot; select ca_id, ca_use, ca_stock_qty, ca_sell_email<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from {$g5[&#39;g5_shop_category_table&#39;]} &quot;;<br />
if ($is_admin != &#39;super&#39;)<br />
&nbsp; &nbsp; $sql .= &quot; where ca_mb_id = &#39;{$member[&#39;mb_id&#39;]}&#39; &quot;;<br />
$sql .= &quot; order by ca_id &quot;;<br />
$result = sql_query($sql);<br />
<br />
for ($i=0; $row=sql_fetch_array($result); $i++)<br />
{<br />
&nbsp; &nbsp; $script .= &quot;ca_use[&#39;{$row[&#39;ca_id&#39;]}&#39;] = {$row[&#39;ca_use&#39;]};\n&quot;;<br />
&nbsp; &nbsp; $script .= &quot;ca_stock_qty[&#39;{$row[&#39;ca_id&#39;]}&#39;] = {$row[&#39;ca_stock_qty&#39;]};\n&quot;;<br />
&nbsp; &nbsp; $script .= &quot;ca_sell_email[&#39;{$row[&#39;ca_id&#39;]}&#39;] = &#39;&quot;.addslashes($row[&#39;ca_sell_email&#39;]).&quot;&#39;;\n&quot;;<br />
}<br />
<br />
<br />
<br />
<br />
<strong><span style="font-size:18px;">4-2.</span></strong> /adm/shop_admin/itemform.php<br />
&lt;&lt;&lt;&lt;&nbsp;변경전 &gt;&gt;&gt;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;select id=&quot;sch_relation&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&#39;&#39;&gt;분류별 상품&lt;/option&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &quot; select * from {$g5[&#39;g5_shop_category_table&#39;]} &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($is_admin != &#39;super&#39;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; where ca_mb_id = &#39;{$member[&#39;mb_id&#39;]}&#39; &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; order by ca_order, ca_id &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = sql_query($sql);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $row=sql_fetch_array($result); $i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $len = strlen($row[&#39;ca_id&#39;]) / 2 - 1;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nbsp = &quot;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $i&lt;$len; $i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nbsp .= &quot; &nbsp; &quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;option value=\&quot;{$row[&#39;ca_id&#39;]}\&quot;&gt;$nbsp{$row[&#39;ca_name&#39;]}&lt;/option&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/select&gt;<br />
<br />
<br />
&lt;&lt;&lt;&lt; &nbsp;변경후 &gt;&gt;&gt;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;select id=&quot;sch_relation&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;option value=&#39;&#39;&gt;분류별 상품&lt;/option&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &quot; select * from {$g5[&#39;g5_shop_category_table&#39;]} &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($is_admin != &#39;super&#39;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; where ca_mb_id = &#39;{$member[&#39;mb_id&#39;]}&#39; &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; order by ca_order, ca_id &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = sql_query($sql);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $row=sql_fetch_array($result); $i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $len = strlen($row[&#39;ca_id&#39;]) / 2 - 1;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nbsp = &quot;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $i&lt;$len; $i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nbsp .= &quot; &nbsp; &quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;option value=\&quot;{$row[&#39;ca_id&#39;]}\&quot;&gt;$nbsp{$row[&#39;ca_name&#39;]}&lt;/option&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }*/<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo make_shop_category_options();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/select&gt;]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 20 Mar 2026 14:42:26 +0900</dc:date>
</item>


<item>
<title>로그인 세션 확인용 페이지</title>
<link>https://www.happyjung.com/lecture/3333</link>
<description><![CDATA[오늘 급작스럽게 로그인이 안되는 상황에 직면했습니다.<br />
bbs/login.php -&gt; login_check.php 의 흐름을 거치면서 로그인이 되는데,<br />
운영중인 사이트가 급작스럽게 로그인이 안되는 겁니다.<br />
<br />
그래서 테스트 로그인 페이지를 만들었습니다.<br />
그누보드 코어 수정없이 로그인 테스트를 위해서...<br />
<br />
bbs/test_login.php<br />
bbs/test_login_check.php<br />
bbs/test_login_result.php<br />
<br />
테스트 결과는 아래에 로그 저장됩니다<br />
data/log/test_lotin_오늘날짜.log&nbsp;<br />
<br />
<img src="https://happyjung.diskn.com/data/lecture/g5_login_error_202512_1.png" /><br />
<br />
<img src="https://happyjung.diskn.com/data/lecture/g5_login_error_202512_2.png" />]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Tue, 03 Feb 2026 11:54:43 +0900</dc:date>
</item>


<item>
<title>그누보드5 디비 g5_uniqid 2일전 데이터 자동삭제</title>
<link>https://www.happyjung.com/lecture/3332</link>
<description><![CDATA[g5_uniqid 가 엄청 쌓여서 extend 폴더에 업로드 해서, 자동으로 삭제되도록 만들었습니다.<br />
extend 폴더에 uniqid_cleanup.extend.php 을 생성해서 아래 내용을 저장 업로드 합니다<br />
g5_uniqid 에는 영카트 쇼핑몰에서 장바구니, 주문하기 등에서 사용된다고 합니다.<br />
&nbsp;<br />
&lt;?php<br />
// extend/uniqid_cleanup.extend.php<br />
// ────────────────────────────────────────<br />
// g5_uniqid 자동정리 + 테이블 최적화 + 로그 크기 제한<br />
// - 상품이 없을 때: 2일 이전 삭제<br />
// - 상품이 있을 때: 30일 이전 삭제<br />
// ver.2025.11.06-final-const (PHP 5.4~8.x 호환)<br />
// ────────────────────────────────────────<br />
if (!defined(&#39;_GNUBOARD_&#39;)) exit;<br />
// ─────────────────────────────<br />
// 설정 상수 (필요 시만 수정)<br />
// ─────────────────────────────<br />
define(&#39;UNIQID_CLEANUP_DAYS_NOITEM&#39;, 2); &nbsp; // 상품이 없을 때 삭제 기준 (일)<br />
define(&#39;UNIQID_CLEANUP_DAYS_HASITEM&#39;, 30); // 상품이 있을 때 삭제 기준 (일)<br />
define(&#39;UNIQID_CLEANUP_LOG_MAXSIZE&#39;, 1048576); // 로그 최대 크기 1MB<br />
// 디렉토리 보장<br />
@mkdir(G5_DATA_PATH . &#39;/cache&#39;, G5_DIR_PERMISSION, true);<br />
@mkdir(G5_DATA_PATH . &#39;/log&#39;, G5_DIR_PERMISSION, true);<br />
// 하루 1회만 실행되도록 캐시파일 이용<br />
$uniqid_cleanup_flag_file = G5_DATA_PATH . &#39;/cache/uniqid_cleanup.flag&#39;;<br />
$uniqid_cleanup_today = date(&#39;Y-m-d&#39;);<br />
// 오늘 이미 실행했는지 확인<br />
if (!file_exists($uniqid_cleanup_flag_file) || trim(@file_get_contents($uniqid_cleanup_flag_file)) !== $uniqid_cleanup_today) {<br />
&nbsp; &nbsp; // 실행 날짜 기록<br />
&nbsp; &nbsp; @file_put_contents($uniqid_cleanup_flag_file, $uniqid_cleanup_today);<br />
&nbsp; &nbsp; // 테이블명 결정<br />
&nbsp; &nbsp; $uniqid_cleanup_table = isset($g5[&#39;uniqid_table&#39;]) ? $g5[&#39;uniqid_table&#39;] : G5_TABLE_PREFIX.&#39;uniqid&#39;;<br />
&nbsp; &nbsp; // 쇼핑몰 상품 존재 여부 확인<br />
&nbsp; &nbsp; $uniqid_cleanup_shop_item_table = isset($g5[&#39;g5_shop_item_table&#39;]) ? $g5[&#39;g5_shop_item_table&#39;] : G5_TABLE_PREFIX.&#39;shop_item&#39;;<br />
&nbsp; &nbsp; $uniqid_cleanup_item_count = (int)sql_fetch_value(&quot;SELECT COUNT(*) FROM `{$uniqid_cleanup_shop_item_table}`&quot;);<br />
&nbsp; &nbsp; // 상품 개수에 따라 삭제 기준 일수 설정<br />
&nbsp; &nbsp; $uniqid_cleanup_days = ($uniqid_cleanup_item_count &gt; 0) ? UNIQID_CLEANUP_DAYS_HASITEM : UNIQID_CLEANUP_DAYS_NOITEM;<br />
&nbsp; &nbsp; $uniqid_cleanup_expire_id = (int)date(&#39;Ymd00000000&#39;, strtotime(&quot;-{$uniqid_cleanup_days} days&quot;));<br />
&nbsp; &nbsp; // ─────────────────────────────<br />
&nbsp; &nbsp; // 1. 기간 경과 데이터 삭제<br />
&nbsp; &nbsp; // ─────────────────────────────<br />
&nbsp; &nbsp; $uniqid_cleanup_del_sql = &quot;DELETE FROM `{$uniqid_cleanup_table}` WHERE `uq_id` &lt; {$uniqid_cleanup_expire_id}&quot;;<br />
&nbsp; &nbsp; sql_query($uniqid_cleanup_del_sql, false);<br />
&nbsp; &nbsp; // ─────────────────────────────<br />
&nbsp; &nbsp; // 2. 테이블 최적화 (공간회수)<br />
&nbsp; &nbsp; // ─────────────────────────────<br />
&nbsp; &nbsp; $uniqid_cleanup_opt_sql = &quot;OPTIMIZE TABLE `{$uniqid_cleanup_table}`&quot;;<br />
&nbsp; &nbsp; sql_query($uniqid_cleanup_opt_sql, false);<br />
&nbsp; &nbsp; // ─────────────────────────────<br />
&nbsp; &nbsp; // 3. 로그 기록 (1MB 초과 시 초기화)<br />
&nbsp; &nbsp; // ─────────────────────────────<br />
&nbsp; &nbsp; $uniqid_cleanup_log_path = G5_DATA_PATH . &#39;/log/uniqid_cleanup.log&#39;;<br />
&nbsp; &nbsp; if (file_exists($uniqid_cleanup_log_path) &amp;&amp; filesize($uniqid_cleanup_log_path) &gt; UNIQID_CLEANUP_LOG_MAXSIZE) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; @unlink($uniqid_cleanup_log_path);<br />
&nbsp; &nbsp; &nbsp; &nbsp; @file_put_contents($uniqid_cleanup_log_path, &quot;[&quot;.date(&#39;Y-m-d H:i:s&#39;).&quot;] log reset (size &gt; 1MB)\n&quot;);<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; // 로그 작성<br />
&nbsp; &nbsp; $uniqid_cleanup_msg = sprintf(&quot;[%s] cleanup done &mdash; deleted uq_id &lt; %s (%d days old), optimized table: %s, shop items: %d\n&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; date(&#39;Y-m-d H:i:s&#39;), $uniqid_cleanup_expire_id, $uniqid_cleanup_days, $uniqid_cleanup_table, $uniqid_cleanup_item_count);<br />
&nbsp; &nbsp; @file_put_contents($uniqid_cleanup_log_path, $uniqid_cleanup_msg, FILE_APPEND);<br />
}]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Tue, 03 Feb 2026 11:51:22 +0900</dc:date>
</item>


<item>
<title>오픈예정 페이지 만들기</title>
<link>https://www.happyjung.com/lecture/3331</link>
<description><![CDATA[홈페이지 작업중일때, 특정 도메인으로만 접근 가능하게 하고 싶은 경우 적용하기 위해 만들었습니다.<br />
<br />
예를 들어, &nbsp;정식 도메인으로 접속하면 공사중 페이지가 보이고<br />
테스트 도메인으로 접속하면 실제 홈페이지가 열리는 방법입니다.<br />
<br />
<img src="https://happyjung.diskn.com/data/lecture/g5_ing_20260202.png" style="width:100%; max-width:1200px;" /><br />
<br />
<strong><span style="font-size:18px;">1.</span></strong> /_ing.php 페이지 생성<br />
첨부파일을 &nbsp;업로드 합니다<br />
( 소스 내용에 exit; 등 일부 코드가 에디터에서 허락되지 않아 파일 첨부 했습니다&nbsp;)<br />
<br />
<br />
<strong><span style="font-size:18px;">2.</span></strong> /config.php 에 아래와 같이 수정합니다<br />
<br />
&lt;?php<br />
// /config.php<br />
include_once(__DIR__.&#39;/_ing.php&#39;);<br />
<br />
/********************<br />
&nbsp; &nbsp; 상수 선언<br />
********************/]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Mon, 02 Feb 2026 19:40:02 +0900</dc:date>
</item>


<item>
<title>Google(구글) 서치콘솔 - 사용자 및 권한 추가</title>
<link>https://www.happyjung.com/lecture/3307</link>
<description><![CDATA[구글 서치콘솔 (웹마스터도구) 의 사용자 및 권한 추가 방법입니다.<br />
<br />
1. 구글 서치콘솔 접속<br />
2. 연결할 도메인 선택<br />
3. 왼쪽 메뉴 &nbsp;- &nbsp;설정 &nbsp;클릭<br />
4. 설정 &nbsp;- &nbsp;사용자 권한 &nbsp;클릭<br />
5. 사용자 추가 &nbsp; 클릭<br />
6. 이메일 주소 &nbsp;= &nbsp;happyjungcom@gmail.com<br />
7. 권한 &nbsp;= &nbsp;전체<br />
8. 추가<br />
<br />
<img src="https://happyjung.diskn.com/data/lecture/google_search_console_user_add_01.png" /><br />
<img src="https://happyjung.diskn.com/data/lecture/google_search_console_user_add_02.png" />]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Wed, 15 Oct 2025 17:04:51 +0900</dc:date>
</item>


<item>
<title>MySQL 기능 on update current_timestamp 사용하기</title>
<link>https://www.happyjung.com/lecture/3303</link>
<description><![CDATA[mysql에서 ON UPDATE CURRENT_TIMESTAMP 란?<br />
&nbsp;<br />
데이터가 바뀔 때마다 자동으로 원하는 컬럼에 현재 시간으로 자동 업데이트 해주는 기능이다.<br />
&nbsp;<br />
보통 &#39;수정한 날짜&#39;에 해당하는 컬럼에 많이 쓰이는 것으로 보인다.&nbsp;<br />
&nbsp;<br />
mysql에서는 테이블 생성 당시에 해당 기능을 만들 수 있다.<br />
<br />
<br />
CREATE TABLE `demo_table` (<br />
&nbsp; &nbsp;`modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP<br />
)<br />
<br />
<br />
예:<br />
컬럼명 : bn_update<br />
Data Type : timestamp<br />
디폴트 : CURRENT_TIMESTAMP<br />
Extra : on update CURRENT_TIMESTAMP<br />
<br />
<br />
&nbsp;<br />
참고자료<br />
<a href="https://roeldowney.tistory.com/567" target="_blank">https://roeldowney.tistory.com/567</a>]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Thu, 28 Aug 2025 17:54:38 +0900</dc:date>
</item>


<item>
<title>[네이버] 외부 메일로 네이버 메일 사용하기</title>
<link>https://www.happyjung.com/lecture/3301</link>
<description><![CDATA[<meta charset="UTF-8" /><meta charset="UTF-8" />네이버 이메일을 웹페이지에 SMTP 외부메일 설정에서 사용하는 방법입니다.<br />
<br />
네이버 2단계 인증관리 &gt; 애플리케이션 등록<br />
<a href="https://help.naver.com/service/5640/contents/8584?lang=ko" target="_blank">https://help.naver.com/service/5640/contents/8584?lang=ko</a><br />
<br />
<br />
<span style="font-size:16px;"><strong>1.</strong></span>&nbsp;구조도<br />
&nbsp; <meta charset="UTF-8" />├ &nbsp;lib<br />
&nbsp;&nbsp;<meta charset="UTF-8" />│&nbsp;&nbsp;&nbsp; &nbsp;└&nbsp;mailer.lib.php<br />
&nbsp; <meta charset="UTF-8" />├ &nbsp;plugin<br />
&nbsp;&nbsp;<meta charset="UTF-8" />│&nbsp;&nbsp;&nbsp; &nbsp;└ &nbsp;PHPMailer-6.9.3<br />
&nbsp;&nbsp;<meta charset="UTF-8" />│&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<meta charset="UTF-8" />└&nbsp;src<br />
&nbsp;&nbsp;<meta charset="UTF-8" />│&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<meta charset="UTF-8" />├ &nbsp;DSNConfigurator.php<br />
&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<meta charset="UTF-8" />├ &nbsp;Exception.php<br />
<meta charset="UTF-8" />&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<meta charset="UTF-8" />├ &nbsp;OAuth.php<br />
&nbsp;&nbsp;<meta charset="UTF-8" />│&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<meta charset="UTF-8" />├ &nbsp;OAuthTokenProvider.php<br />
&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<meta charset="UTF-8" />├ &nbsp;PHPMailer.php<br />
<meta charset="UTF-8" />&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<meta charset="UTF-8" />├ &nbsp;POP3.php<br />
<meta charset="UTF-8" />&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<meta charset="UTF-8" />└ &nbsp;SMTP.php<br />
<meta charset="UTF-8" />&nbsp; └ &nbsp;test_mail.php<br />
<br />
<br />
<meta charset="UTF-8" /><span style="font-size:16px;"><strong>2.</strong></span>&nbsp;네이버 메일에서 SMTP 사용으로 변경<br />
<br />
네이버 메일 &nbsp;&gt; &nbsp;환경설정 &nbsp;&gt; &nbsp;POS3/IMAP 설정 &nbsp;&gt; &nbsp;IMAP/SMTP 설정 &nbsp;페이지에서<br />
POS3/SMTP 사용 &nbsp;&gt; &nbsp;사용함 &nbsp; 으로 변경<br />
<br />
<br />
<br />
<strong><span style="font-size:16px;">3.</span></strong>&nbsp;PHPMailer 폴더 업로드<br />
PHPMailer 다운로드 후 plugin 폴더에 업로드<br />
PHPMailer 최신버전을 다운로드 :&nbsp;<a href="https://github.com/PHPMailer/PHPMailer" target="_blank">https://github.com/PHPMailer/PHPMailer</a><br />
<br />
<br />
<br />
<strong><span style="font-size:16px;">4.</span></strong>&nbsp;lib / mailer_naver.lib.php 생성<br />
&lt;?php<br />
use PHPMailer\PHPMailer\PHPMailer;<br />
use PHPMailer\PHPMailer\Exception;<br />
use PHPMailer\PHPMailer\SMTP;<br />
<br />
function mailer_naver($to_email, $to_name, $from_email, $from_name, $subject, $content, $is_html = true) {<br />
&nbsp; &nbsp; require_once(&#39;<strong><span style="color:#ff0000;">/절대경로/plugin/PHPMailer-6.9.3</span></strong>/src/PHPMailer.php&#39;);<br />
&nbsp; &nbsp; require_once(&#39;<strong><span style="color:#ff0000;">/절대경로/plugin/PHPMailer-6.9.3</span></strong>/src/SMTP.php&#39;);<br />
&nbsp; &nbsp; require_once(&#39;<strong><span style="color:#ff0000;">/절대경로/plugin/PHPMailer-6.9.3</span></strong>/src/Exception.php&#39;);<br />
<br />
&nbsp; &nbsp; $mail = new PHPMailer(true);<br />
<br />
&nbsp; &nbsp; try {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // SMTP 설정<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;isSMTP();<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Host = &#39;smtp.naver.com&#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;SMTPAuth = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Username = &#39;네이버_아이디@naver.com&#39;; &nbsp;// 네이버 이메일 주소<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Password = &#39;네이버_앱 _비밀번호&#39;; &nbsp;// 네이버 앱 비밀번호 (2단계 인증 앱비밀번호)<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // SSL<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Port = &#39;465&#39;; // 네이버 SMTP 포트<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 한글 깨짐 방지<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;CharSet = &#39;UTF-8&#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Encoding = &#39;base64&#39;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 보내는 사람 설정<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;setFrom($from_email, &#39;=?UTF-8?B?&#39;.base64_encode($from_name).&#39;?=&#39;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;addAddress($to_email, &#39;=?UTF-8?B?&#39;.base64_encode($to_name).&#39;?=&#39;);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 메일 제목 한글 깨짐 방지<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Subject = &#39;=?UTF-8?B?&#39;.base64_encode($subject).&#39;?=&#39;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // HTML 메일 여부 설정<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;isHTML($is_html);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Body = $content;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 메일 전송<br />
&nbsp; &nbsp; &nbsp; &nbsp; return $mail-&gt;send();<br />
&nbsp; &nbsp; } catch (Exception $e) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; error_log(&#39;메일 발송 실패: &#39; . $mail-&gt;ErrorInfo);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; }<br />
}<br />
<br />
<br />
<br />
<strong><span style="font-size:16px;">5.</span></strong>&nbsp;test_mail.php &nbsp;만들어서&nbsp;웹브라우저로 실행<br />
&lt;?php<br />
$to_email &nbsp; = &#39;받는_이메일주소&#39;;<meta charset="UTF-8" />&nbsp;// 받을 이메일 주소<br />
$to_name &nbsp; &nbsp;= &#39;받는사람_이름&#39;;<meta charset="UTF-8" />&nbsp;// 받는 이름<br />
$from_email = &#39;<strong><span style="color:#ff0000;">네이버_아이디</span></strong>@naver.com&#39;; // mailer_naver.lib.php 에 등록정보와 일치해야합니다<br />
$from_name &nbsp;= &#39;보내는사람_이름&#39;; &nbsp;//&nbsp;보내는사람_이름<br />
$subject &nbsp; &nbsp;= <meta charset="UTF-8" />&#39;Title 네이버 SMTP 테스트 메일&#39;; // 이메일 제목<br />
$content &nbsp; &nbsp;= &#39;&lt;p&gt;안녕하세요! 이 메일은 한글 인코딩 테스트입니다.&lt;/p&gt;&#39;;<br />
<br />
include_once(&quot;<strong><span style="color:#ff0000;">./lib</span></strong>/mailer_naver.lib.php&quot;);<br />
if (mailer_naver($to_email, $to_name, $from_email, $from_name, $subject, $content)) {<br />
&nbsp; &nbsp; echo &#39;이메일이 정상적으로 발송되었습니다.&#39;;<br />
} else {<br />
&nbsp; &nbsp; echo &#39;이메일 발송에 실패했습니다.&#39;;<br />
}]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 07 Feb 2025 09:27:21 +0900</dc:date>
</item>


<item>
<title>[네이버][G5] 외부 메일로 네이버 메일 사용하기</title>
<link>https://www.happyjung.com/lecture/3300</link>
<description><![CDATA[네이버 이메일을 그누보드 SMTP 외부메일 설정에서 사용하는 방법입니다.<br />
환경설정 &gt; 관리자메일 주소는 config.php 에 등록하는 네이버 메일주소와 일치해야 합니다.<br />
<br />
<br />
네이버 2단계 인증관리 &gt; 애플리케이션 등록<br />
<a href="https://help.naver.com/service/5640/contents/8584?lang=ko" target="_blank">https://help.naver.com/service/5640/contents/8584?lang=ko</a><br />
<br />
<br />
<meta charset="UTF-8" /><strong>1.</strong>&nbsp;구조도<br />
그누보드 5<br />
&nbsp;&nbsp;├ &nbsp;lib<br />
&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp; &nbsp;└&nbsp;mailer.lib.php<br />
&nbsp;&nbsp;├ &nbsp;plugin<br />
&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp; &nbsp;└ &nbsp;PHPMailer-6.9.3<br />
&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└&nbsp;src<br />
&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;├ &nbsp;DSNConfigurator.php<br />
&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;├ &nbsp;Exception.php<br />
&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;├ &nbsp;OAuth.php<br />
&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;├ &nbsp;OAuthTokenProvider.php<br />
&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;├ &nbsp;PHPMailer.php<br />
&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;├ &nbsp;POP3.php<br />
&nbsp; │&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;└ &nbsp;SMTP.php<br />
&nbsp; └ &nbsp;test_mail.php<br />
<br />
<br />
<br />
<span style="font-size:16px;"><strong>2.</strong></span> 네이버 메일에서 SMTP 사용으로 변경<br />
<br />
네이버 메일 &nbsp;&gt; &nbsp;환경설정 &nbsp;&gt; &nbsp;POS3/IMAP 설정 &nbsp;&gt; &nbsp;IMAP/SMTP 설정 &nbsp;페이지에서<br />
POS3/SMTP 사용 &nbsp;&gt; &nbsp;사용함 &nbsp; 으로 변경<br />
<br />
&nbsp;<br />
<br />
<strong><span style="font-size:16px;">3.</span></strong> /config.php 173 번째 줄에 있는<br />
define(&#39;G5_SMTP&#39;, &nbsp; &nbsp; &nbsp;&#39;127.0.0.1&#39;);<br />
define(&#39;G5_SMTP_PORT&#39;, &#39;25&#39;);<br />
&nbsp;<br />
를 아래와 같이 수정합니다.<br />
&nbsp;<br />
define(&#39;G5_SMTP&#39;, &#39;smtp.naver.com&#39;);<br />
define(&#39;G5_SMTP_PORT&#39;, &#39;587&#39;);<br />
define(&#39;G5_SMTP_SECURE&#39;, &#39;TLS&#39;);<br />
define(&#39;G5_SMTP_USER&#39;, &#39;<strong><span style="color:#ff0000;">yourid</span></strong>@naver.com&#39;);<br />
define(&#39;G5_SMTP_PW&#39;, &#39;<strong><span style="color:#ff0000;">yourpassword</span></strong>&#39;); &nbsp;// 네이버 앱 비밀번호 (2단계 인증 앱비밀번호)<br />
&nbsp;<br />
<br />
<br />
<strong><span style="font-size:16px;">4.</span></strong> /lib/mailer.lib.php 19번째 줄<br />
&nbsp;<br />
&nbsp; &nbsp; $mail = new PHPMailer(); // defaults to using php &quot;mail()&quot;<br />
&nbsp; &nbsp; if (defined(&#39;G5_SMTP&#39;) &amp;&amp; G5_SMTP) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;IsSMTP(); // telling the class to use SMTP<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Host = G5_SMTP; // SMTP server<br />
&nbsp; &nbsp; &nbsp; &nbsp; if(defined(&#39;G5_SMTP_PORT&#39;) &amp;&amp; G5_SMTP_PORT)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Port = G5_SMTP_PORT;<br />
&nbsp; &nbsp; }<br />
&nbsp;<br />
를 아래와 같이 수정합니다.<br />
&nbsp;<br />
&nbsp; &nbsp; $mail = new PHPMailer(); // defaults to using php &quot;mail()&quot;<br />
&nbsp; &nbsp; if (defined(&#39;G5_SMTP&#39;) &amp;&amp; G5_SMTP) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;IsSMTP(); // telling the class to use SMTP<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Host = G5_SMTP; // SMTP server<br />
&nbsp; &nbsp; &nbsp; &nbsp; //if(defined(&#39;G5_SMTP_PORT&#39;) &amp;&amp; G5_SMTP_PORT)<br />
&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp;$mail-&gt;Port = G5_SMTP_PORT;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if(defined(&#39;G5_SMTP_PORT&#39;) &amp;&amp; G5_SMTP_PORT) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Port = G5_SMTP_PORT;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;SMTPAuth = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;AuthType = &quot;LOGIN&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;SMTPSecure = G5_SMTP_SECURE;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Username = G5_SMTP_USER;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Password = G5_SMTP_PW;<br />
&nbsp; &nbsp; }<br />
<br />
<br />
<br />
<strong><span style="font-size:16px;">5.</span></strong>&nbsp;그누보드5 &nbsp;&gt; &nbsp;환경설정 &nbsp;&gt; &nbsp;메일 테스트<br />
다양한 메일 계정으로 테스트 발송<br />
네이버, 다음(카카오), 구글 등<br />
<br />
<br />
<br />
<strong><span style="font-size:16px;">6.</span></strong> 일반 페이지에서 사용하기<br />
일반페이지에서 사용할때는 별도로 만든 mailer 를 사용하는것이 좋습니다.<br />
PHPMailer 다운로드 후 plugin 폴더에 업로드<br />
PHPMailer 최신버전을 다운로드 : <a href="https://github.com/PHPMailer/PHPMailer" target="_blank">https://github.com/PHPMailer/PHPMailer</a><br />
<br />
<br />
<br />
<strong><span style="font-size:16px;">7.</span></strong>&nbsp;lib / mailer_naver.lib.php &nbsp;파일 생성<br />
<br />
&lt;?php<br />
if (!defined(&#39;_GNUBOARD_&#39;)) exit;<br />
include_once(&quot;_common.php&quot;);<br />
// lib 폴더에 PHPMailer 업로드<br />
// PHPMailer 다운로드 : https://github.com/PHPMailer/PHPMailer<br />
<br />
use PHPMailer\PHPMailer\PHPMailer;<br />
use PHPMailer\PHPMailer\Exception;<br />
use PHPMailer\PHPMailer\SMTP;<br />
<br />
function mailer_naver($to_email, $to_name, $from_email, $from_name, $subject, $content, $is_html = true) {<br />
&nbsp; &nbsp; require_once(G5_PLUGIN_PATH . &#39;/<strong><span style="color:#ff0000;">PHPMailer-6.9.3</span></strong>/src/PHPMailer.php)&#39;;<br />
&nbsp; &nbsp; require_once(G5_PLUGIN_PATH . &#39;/<strong><span style="color:#ff0000;">PHPMailer-6.9.3</span></strong>/src/SMTP.php)&#39;;<br />
&nbsp; &nbsp; require_once(G5_PLUGIN_PATH . &#39;/<strong><span style="color:#ff0000;">PHPMailer-6.9.3</span></strong>/src/Exception.php)&#39;;<br />
<br />
&nbsp; &nbsp; $mail = new PHPMailer(true);<br />
<br />
&nbsp; &nbsp; try {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // SMTP 설정<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;isSMTP();<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Host = &#39;smtp.naver.com&#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;SMTPAuth = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; //$mail-&gt;Username = &#39;<strong><span style="color:#ff0000;">yourid</span></strong>@naver.com&#39;; &nbsp;// 네이버 이메일 주소<br />
&nbsp; &nbsp; &nbsp; &nbsp; //$mail-&gt;Password = &#39;<strong><span style="color:#ff0000;">yourpassword</span></strong>&#39;; &nbsp;// 네이버 앱 비밀번호 (2단계 인증 앱비밀번호)<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Username = G5_SMTP_USER; &nbsp;// 네이버 이메일 주소<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Password = G5_SMTP_PW; &nbsp;// 네이버 앱 비밀번호 (2단계 인증 앱비밀번호) // 의료입자방사선연구회<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // SSL<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Port = &#39;465&#39;; // 네이버 SMTP 포트<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 한글 깨짐 방지<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;CharSet = &#39;UTF-8&#39;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Encoding = &#39;base64&#39;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 보내는 사람 설정<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;setFrom($from_email, &#39;=?UTF-8?B?&#39;.base64_encode($from_name).&#39;?=&#39;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;addAddress($to_email, &#39;=?UTF-8?B?&#39;.base64_encode($to_name).&#39;?=&#39;);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 메일 제목 한글 깨짐 방지<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Subject = &#39;=?UTF-8?B?&#39;.base64_encode($subject).&#39;?=&#39;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // HTML 메일 여부 설정<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;isHTML($is_html);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mail-&gt;Body = $content;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // 메일 전송<br />
&nbsp; &nbsp; &nbsp; &nbsp; return $mail-&gt;send();<br />
&nbsp; &nbsp; } catch (Exception $e) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; error_log(&#39;메일 발송 실패: &#39; . $mail-&gt;ErrorInfo);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; }<br />
}<br />
<br />
<br />
<br />
<strong><span style="font-size:16px;">8.</span></strong>&nbsp;test_mail.php &nbsp;만들어서&nbsp;웹브라우저로 실행<br />
<br />
&lt;?php<br />
include_once(&#39;./common.php&#39;);<br />
<br />
$from_email = $config[&#39;cf_admin_email&#39;]; // 환경설정에 등록된 이메일주소<br />
$from_name &nbsp;= $config[&#39;cf_admin_email_name&#39;]; // 환경설정에 등록된 이름<br />
$to_email &nbsp; = &#39;받는_이메일주소&#39;; &nbsp;// 받을 이메일 주소<br />
$to_name &nbsp; &nbsp;= &#39;받는_이름&#39;; // 받는 이름<br />
$mail_subject = &#39;Title 네이버 SMTP 테스트 메일&#39;; // 이메일 제목<br />
$mail_content = &#39;&lt;p&gt;Message 이메일이 정상적으로 발송되었습니다.&lt;/p&gt;&#39;; // 이메일 내용<br />
<br />
include_once(G5_LIB_PATH . &#39;/mailer_naver.lib.php&#39;);<br />
if (mailer_naver($to_email, $to_name, $from_email, $from_name, $subject, $content)) {<br />
&nbsp; &nbsp; echo &#39;이메일이 정상적으로 발송되었습니다.&#39;;<br />
} else {<br />
&nbsp; &nbsp; echo &#39;이메일 발송에 실패했습니다.&#39;;<br />
}<br />
<br />
&nbsp;<br />
&nbsp;관련자료<br />
<a href="http:// https://sir.kr/g5_tip/22471" target="_blank">https://sir.kr/g5_tip/22471</a>]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 07 Feb 2025 08:55:41 +0900</dc:date>
</item>


<item>
<title>[SQL Injection] 그누보드에 적용된 SQL 인젝션 대응코드</title>
<link>https://www.happyjung.com/lecture/3299</link>
<description><![CDATA[<br />
// Blind SQL Injection 취약점 해결<br />
$sql = trim($sql);<br />
// union의 사용을 허락하지 않습니다.<br />
//$sql = preg_replace(&quot;#^select.*from.*union.*#i&quot;, &quot;select 1&quot;, $sql);<br />
$sql = preg_replace(&quot;#^select.*from.*[\s\(]+union[\s\)]+.*#i &quot;, &quot;select 1&quot;, $sql);<br />
// `information_schema` DB로의 접근을 허락하지 않습니다.<br />
$sql = preg_replace(&quot;#^select.*from.*where.*`?information_schema`?.*#i&quot;, &quot;select 1&quot;, $sql);<br />
<br />
<br />
// 사용자 입력을 필터링하여 적절한 형식인지 확인<br />
// <a href="http://www.w3bai.com/ko/php/filter_sanitize_string.html#gsc.tab=0" target="_blank">http://www.w3bai.com/ko/php/filter_sanitize_string.html#gsc.tab=0</a><br />
//&nbsp;<a href="http://www.w3bai.com/ko/php/php_ref_filter.html#gsc.tab=0" target="_blank">http://www.w3bai.com/ko/php/php_ref_filter.html#gsc.tab=0</a><br />
// <a href="https://www.php.net/manual/en/function.filter-var.php" target="_blank">https://www.php.net/manual/en/function.filter-var.php</a><br />
$comment = $_POST[&#39;comment&#39;];<br />
$comment = filter_var($comment, FILTER_SANITIZE_STRING);&nbsp;// 문자열에서 태그 / 특수 문자를 제거합니다<br />
$comment = filter_var($comment, FILTER_SANITIZE_NUMBER_INT); // 숫자와 +를 제외한 모든 문자를 제거합니다 -<br />
<br />
<br />
// 데이터베이스로부터 가져온 변수 출력 시 HTML 이스케이프 적용<br />
// <a href="https://www.php.net/manual/en/function.htmlspecialchars.ph" target="_blank">https://www.php.net/manual/en/function.htmlspecialchars.ph</a>p<br />
echo htmlspecialchars(comment, ENT_QUOTES, &#39;UTF-8&#39;);<br />
<br />
<br />
//<br />
$type = isset($_REQUEST[&#39;type&#39;]) ? preg_replace(&quot;/[\&lt;\&gt;\&#39;\&quot;\\\&#39;\\\&quot;\%\=\(\)\s]/&quot;, &quot;&quot;, $_REQUEST[&#39;type&#39;]) : &#39;&#39;;<br />
&nbsp;]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Tue, 26 Nov 2024 21:14:57 +0900</dc:date>
</item>


<item>
<title>[Amina] wr_link1,2 등록된 영상 원본이 삭제된 경우 목록 보기 오류</title>
<link>https://www.happyjung.com/lecture/3298</link>
<description><![CDATA[아미나 빌더를 사용하는 경우, wr_link1 에 vimeo 링크를 삽입하면 본문에 영상이 자동 보여집니다.<br />
게시판 테이블에 as_thumb 컬럼에 썸네일 이미지가 추출 등록되는데, 이것이 공백인것을 체크하지 못하고 이미지 처리를 하려는 시도로 인한 문제가 발생합니다.<br />
<br />
문제된 게시판의 목록의 소스를 보면 목록 상단에서&nbsp;<br />
&nbsp;&nbsp; &nbsp;&lt;div class=&quot;list-wrap&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;form name=&quot;fboardlist&quot; id=&quot;fboardlist&quot; action=&quot;./board_list_update.php&quot; onsubmit=&quot;return fboardlist_submit(this);&quot; method=&quot;post&quot; role=&quot;form&quot; class=&quot;form&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;bo_table&quot; value=&quot;c5&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;sfl&quot; value=&quot;&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;stx&quot; value=&quot;&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;spt&quot; value=&quot;&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;sca&quot; value=&quot;&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;sst&quot; value=&quot;wr_num, wr_reply&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;sod&quot; value=&quot;&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;page&quot; value=&quot;1&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;sw&quot; value=&quot;&quot;&gt;<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class=&quot;list-container&quot;&gt;<br />
이후의 오류가 발생합니다.<br />
<br />
list.skin.php 내용을 보면<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class=&quot;list-container&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;?php<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$k = 0;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for ($i=0; $i &lt; $list_cnt; $i++) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;... 중략 ...<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;// 썸네일<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$list[$i][&#39;no_img&#39;] = $board_skin_url.&#39;/img/no-img.jpg&#39;; // No-Image<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$img = <strong><span style="color:#ff0000;">apms_wr_thumbnail</span></strong>($bo_table, $list[$i], $thumb_w, $thumb_h, false, true);<br />
<br />
<br />
해당 게시글을 디비에서 확인하니 wr_link1 에 https://vimeo.com/111111111&nbsp;의 경로가 확인되었고,<br />
이것을 브라우저로 열어보니 아래와 같이 없는 페이지로 표시되네요<br />
<br />
<img alt="" src="https://happyjung.diskn.com/data/lecture/gnuboard5_amina_vimeo_error_20241122.png" style="width:100%; max-width:1492px;" /><br />
<br />
<br />
이것을 수정하기 위해 아래의 사항을 수정하였습니다.<br />
<br />
lib/apms.video.lib.php&nbsp;<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$tmp_thumb = apms_video_thumbnail($write[&#39;as_thumb&#39;], 1);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if($tmp_thumb) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$z = 1;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$img[0][&#39;img&#39;] = $tmp_thumb;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$img[0][&#39;alt&#39;] = &#39;&#39;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$make_thumb = false;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;unset($write);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
<br />
를 아래와 같이 변경<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$tmp_thumb = apms_video_thumbnail($write[&#39;as_thumb&#39;], 1);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if($tmp_thumb<span style="color:#ff0000;"><strong> &amp;&amp; $write[&#39;as_thumb&#39;]</strong></span>) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$z = 1;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$img[0][&#39;img&#39;] = $tmp_thumb;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$img[0][&#39;alt&#39;] = &#39;&#39;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$make_thumb = false;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;unset($write);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 22 Nov 2024 10:52:33 +0900</dc:date>
</item>


<item>
<title>[카페24] SMS 문자 발송</title>
<link>https://www.happyjung.com/lecture/3297</link>
<description><![CDATA[카페24에서 SMS호스팅 이용할때 쉽게 사용하도록 정리하였습니다.<br />
<br />
<br />
<strong><span style="font-size:15px;">1.</span></strong> 문자연동페이지에 삽입할 내용<br />
아래에 post 또는 적용될 내용을 대입합니다.<br />
&lt;?php<br />
//cafe24 문자발송<br />
$sms_action &nbsp; = &quot;&quot;; // 실제발송 go<br />
$sms_smsType &nbsp;= &quot;S&quot;; // S 단문(SMS) &nbsp;L 장문(LMS)<br />
$sms_subject &nbsp;= &quot;&quot;; // 제목<br />
$sms_msg &nbsp; &nbsp; &nbsp;= &quot;&quot;; // 메시지<br />
$sms_rphone &nbsp; = &quot;010-1111-2222&quot;; // 받는번호<br />
$sms_testflag = &quot;Y&quot;; // 테스트발송 Y<br />
include(&quot;sms_cafe24.php&quot;);<br />
?&gt;<br />
<br />
<br />
<strong><span style="font-size:15px;">2.</span></strong> sms_cafe24.php 파일 생성<br />
&lt;?php<br />
// cafe24 SMS 발송<br />
$sms_userid &nbsp;= &quot;&quot;; //SMS 아이디.<br />
$sms_secure &nbsp;= &quot;&quot;; //인증키<br />
<br />
// 010-3775-0927<br />
$sms_sphone1 = &quot;010&quot;; &nbsp;// 보내는 번호1 예) 010<br />
$sms_sphone2 = &quot;&quot;; // 보내는 번호2 예) 1234<br />
$sms_sphone3 = &quot;&quot;; // 보내는 번호3 예) 5678<br />
<br />
$sms_alert &nbsp; = &#39;&#39;; // 성공시 대화 상자(alert)를 사용 1<br />
/*<br />
사용할 경우 : 1<br />
성공시 대화 상자(alert)를 사용 하지 않게 합니다.<br />
*/<br />
<br />
//$sms_smsType = $_POST[&#39;smsType&#39;]; // 발송타입<br />
/*<br />
S 단문(SMS)<br />
L 장문(LMS)<br />
&lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;smsType&quot; value=&quot;S&quot;&gt;단문(SMS)&lt;/span&gt;&lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;smsType&quot; value=&quot;L&quot;&gt;장문(LMS)&lt;/span&gt; &lt;br /&gt;<br />
*/<br />
//$sms_msg &nbsp; &nbsp; = $_POST[&#39;msg&#39;]; // 메시지<br />
/*<br />
예) SMS = 90 byte 이하, LMS = 2,000 byte 이하 까지 입력 (상단 라디오버튼으로 SMS, LMS 선택)<br />
*/<br />
//$sms_subject = $_POST[&#39;subject&#39;]; // 제목<br />
/*<br />
예) 안녕하세요. 카페24입니다. 50byte 이하로 입력<br />
장문(LMS)일 경우에만 제목을 입력할 수 있습니다.<br />
수신자 휴대폰 기종에 따라 입력한 제목이 출력되지 않을 수 있습니다.<br />
발송 시 제목이 없으면 [제목없음]으로 발송됩니다.<br />
*/<br />
//$sms_rphone &nbsp;= $_POST[&#39;rphone&#39;]; // 받는번호<br />
/*<br />
예) 011-012-1234<br />
&#39;-&#39; 포함해서 입력, 받는사람이 여러명이 경우 콤마(,)로 구분해주세요<br />
잘못된 전화번호는 전송되지 않습니다.<br />
※ destination 변수 사용시에는 &quot;&quot; 으로 비워주세요.<br />
*/<br />
<br />
$sms_rdate &nbsp; = $_POST[&#39;rdate&#39;]; // 예약날짜 예) 20080930<br />
$sms_rtime &nbsp; = $_POST[&#39;rtime&#39;]; // 예약시간<br />
/*<br />
예) 173000<br />
오후 5시 30분<br />
예약시간은 최소 10분 이상으로 설정하셔야합니다.<br />
*/<br />
$sms_returnurl &nbsp; &nbsp;= $_POST[&#39;returnurl&#39;]; // 리턴 URL<br />
/*<br />
메시지 전송 후 이동할 페이지<br />
( http:// 또는 https:// 를 붙이셔야 합니다. )<br />
*/<br />
//$sms_testflag &nbsp; &nbsp; = &quot;Y&quot;; // 테스트 요청<br />
/*<br />
테스트일 경우 : Y<br />
테스트가 아닐 경우 입력하지 마세요.<br />
실제 sms는 보내지 않으나 단순한 페이지 테스트를 위한 용도<br />
*/<br />
$sms_destination &nbsp;= &quot;&quot;;<br />
/*<br />
메시지에 받는 사람 이름을 넣고 싶을 때 이용<br />
destination 값을 &quot;휴대폰번호|이름&quot; 과 같이 &#39;|&#39;문자로 구분해서 입력하시고,<br />
msg값에 &ldquo;{name}&rdquo; 이라는 문구를 입력 후 전송하시면 됩니다.<br />
예)<br />
<br />
&lt;input type=&quot;type&quot; name=&quot;destination&quot; value=&quot;010-000-0000|홍길동,010-000-0000|김영희&quot;&gt;<br />
&lt;input type=&quot;type&quot; name=&quot;msg&quot; value=&quot;{name}님, 주문하신 물품이 배송되었습니다.&quot;&gt;<br />
*/<br />
$sms_repeatFlag &nbsp; = &quot;&quot;; // 반복 설정을 원하는 경우 : Y<br />
$sms_repeatNum &nbsp; &nbsp;= &quot;&quot;; // 반복 횟수 &nbsp;1~10회 가능.<br />
$sms_repeatTime &nbsp; = &quot;&quot;; // 반복 시간 &nbsp;15분 이상부터 가능.<br />
<br />
//echo &quot;&lt;br&gt;sms_action = {$sms_action}&lt;br&gt;&quot;;<br />
<br />
if($_POST[&#39;sms_action&#39;]==&#39;go&#39; || $sms_action==&#39;go&#39;){<br />
&nbsp;&nbsp; &nbsp;/******************** 인증정보 ********************/<br />
&nbsp;&nbsp; &nbsp;$sms_url = &quot;https://sslsms.cafe24.com/sms_sender.php&quot;; // 전송요청 URL<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;user_id&#39;] = base64_encode($sms_userid); //SMS 아이디.<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;secure&#39;] &nbsp;= base64_encode($sms_secure) ; //인증키<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;msg&#39;] = base64_encode(stripslashes($sms_msg));<br />
&nbsp;&nbsp; &nbsp;if( $sms_smsType == &quot;L&quot;){<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$sms[&#39;subject&#39;] &nbsp; = &nbsp;base64_encode($sms_subject);<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;rphone&#39;] &nbsp;= base64_encode($sms_rphone);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;sphone1&#39;] = base64_encode($sms_sphone1);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;sphone2&#39;] = base64_encode($sms_sphone2);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;sphone3&#39;] = base64_encode($sms_sphone3);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;rdate&#39;] &nbsp; = base64_encode($sms_rdate);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;rtime&#39;] &nbsp; = base64_encode($sms_rtime);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;mode&#39;] &nbsp; &nbsp;= base64_encode(&quot;1&quot;); // base64 사용시 반드시 모드값을 1로 주셔야 합니다.<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;returnurl&#39;] &nbsp; = base64_encode($sms_returnurl);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;testflag&#39;] &nbsp; &nbsp;= base64_encode($sms_testflag);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;destination&#39;] = strtr(base64_encode($sms_destination), &#39;+/=&#39;, &#39;-,&#39;);<br />
&nbsp;&nbsp; &nbsp;$returnurl = $sms_returnurl;<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;repeatFlag&#39;] = base64_encode($sms_repeatFlag);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;repeatNum&#39;] &nbsp;= base64_encode($sms_repeatNum);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;repeatTime&#39;] = base64_encode($sms_repeatTime);<br />
&nbsp;&nbsp; &nbsp;$sms[&#39;smsType&#39;] &nbsp; &nbsp;= base64_encode($sms_smsType); // LMS일경우 L<br />
&nbsp;&nbsp; &nbsp;$nointeractive &nbsp; &nbsp; = $sms_alert; //사용할 경우 : 1, 성공시 대화상자(alert)를 생략<br />
<br />
&nbsp;&nbsp; &nbsp;$host_info = explode(&quot;/&quot;, $sms_url);<br />
&nbsp;&nbsp; &nbsp;$host = $host_info[2];<br />
&nbsp;&nbsp; &nbsp;$path = $host_info[3].&quot;/&quot;.$host_info[4];<br />
<br />
&nbsp;&nbsp; &nbsp;srand((double)microtime()*1000000);<br />
&nbsp;&nbsp; &nbsp;$boundary = &quot;---------------------&quot;.substr(md5(rand(0,32000)),0,10);<br />
&nbsp;&nbsp; &nbsp;//print_r($sms);<br />
<br />
&nbsp;&nbsp; &nbsp;// 헤더 생성<br />
&nbsp;&nbsp; &nbsp;$header &nbsp;= &quot;POST /{$path} HTTP/1.0\r\n&quot;;<br />
&nbsp;&nbsp; &nbsp;$header .= &quot;Host: {$host}\r\n&quot;;<br />
&nbsp;&nbsp; &nbsp;$header .= &quot;Content-type: multipart/form-data, boundary={$boundary}\r\n&quot;;<br />
<br />
&nbsp;&nbsp; &nbsp;// 본문 생성<br />
&nbsp;&nbsp; &nbsp;foreach($sms AS $index =&gt; $value){<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$data .=&quot;--{$boundary}\r\n&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$data .= &quot;Content-Disposition: form-data; name=\&quot;{$index}\&quot;\r\n&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$data .= &quot;\r\n{$value}\r\n&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$data .=&quot;--{$boundary}\r\n&quot;;<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;$header .= &quot;Content-length: &quot;. strlen($data) .&quot;\r\n\r\n&quot;;<br />
<br />
&nbsp;&nbsp; &nbsp;$fp = fsockopen($host, 80);<br />
<br />
&nbsp;&nbsp; &nbsp;if ($fp) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fputs($fp, $header.$data);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$rsp = &#39;&#39;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;while(!feof($fp)) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$rsp .= fgets($fp,8192);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fclose($fp);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$msg &nbsp; &nbsp;= explode(&quot;\r\n\r\n&quot;,trim($rsp));<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$rMsg &nbsp; = explode(&quot;,&quot;, $msg[1]);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$Result = $rMsg[0]; //발송결과<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$Count &nbsp;= $rMsg[1]; //잔여건수<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//발송결과 알림<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if($Result==&quot;success&quot;) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert &nbsp;= &quot;성공&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert .= &quot; 잔여건수는 {$Count}건 입니다.&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else if($Result==&quot;reserved&quot;) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert &nbsp;= &quot;성공적으로 예약되었습니다.&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert .= &quot; 잔여건수는 {$Count}건 입니다.&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else if($Result==&quot;3205&quot;) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert = &quot;잘못된 번호형식입니다.&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else if($Result==&quot;0044&quot;) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert = &quot;스팸문자는발송되지 않습니다.&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert = &quot;[Error]{$Result}&quot;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;else {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$alert = &quot;Connection Failed&quot;;<br />
&nbsp;&nbsp; &nbsp;}<br />
<br />
&nbsp;&nbsp; &nbsp;if($nointeractive==&quot;1&quot; &amp;&amp; ($Result!=&quot;success&quot; &amp;&amp; $Result!=&quot;Test Success!&quot; &amp;&amp; $Result!=&quot;reserved&quot;) ) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;script&gt;alert(&#39;{$alert}&#39;)&lt;/script&gt;&quot;;<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;else if($nointeractive!=&quot;1&quot;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;script&gt;alert(&#39;{$alert}&#39;)&lt;/script&gt;&quot;;<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;//echo &quot;&lt;span style=&#39;color:#ffffff;&#39;&gt;문자전송 : {$alert}&lt;/span&gt;&lt;br&gt;&quot;;<br />
&nbsp;&nbsp; &nbsp;//echo &quot;&lt;script&gt;location.href=&#39;{$returnurl}&#39;;&lt;/script&gt;&quot;;<br />
}<br />
exit;]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Tue, 19 Nov 2024 14:41:31 +0900</dc:date>
</item>


<item>
<title>root 계정으로 ssh 직접 접속 막기</title>
<link>https://www.happyjung.com/lecture/3296</link>
<description><![CDATA[리눅스를 설치후 기본적으로 ssh 22 포트가 열려있고, root 직접 접속이 가능하기에 보안에 취약합니다.<br />
root 계정 직접 접속을 막고, 다른 계정으로 로그인후 root 계정으로 전환하도록 하는것이 안전합니다.<br />
<br />
<br />
<strong><span style="font-size:15px;">1.</span></strong> ssh 프로그램 실행<br />
<br />
<br />
<strong><span style="font-size:15px;">2.</span></strong> 일반 user 계정으로 로그인하기<br />
<br />
<br />
<strong><span style="font-size:15px;">3.</span></strong> root 계정 전환 테스트<br />
-bash-4.2$ su<br />
암호:<br />
[root@happyjung happyjung]#&nbsp;<br />
<br />
<br />
<strong><span style="font-size:15px;">3.</span></strong> ssh 설정 파일 수정<br />
# vi /etc/ssh/sshd_config<br />
내용중에서<br />
#PermitRootLogin yes<br />
를 아래와 같이 변경<br />
PermitRootLogin no<br />
<br />
<br />
<strong><span style="font-size:15px;">4.</span></strong> ssh 서비스 재시작<br />
# service sshd restart<br />
Redirecting to /bin/systemctl restart sshd.service<br />
<br />
<br />
<strong><span style="font-size:15px;">5.</span></strong> ssh 새창으로 root 게정으로 접속 확인<br />
접속 불가능 확인<br />
<br />
<br />
<strong><span style="font-size:15px;">6.</span></strong> ssh 새창으로 유저계정 로그인 후&nbsp;root로 계정전환되는지 확인<br />
-bash-4.2$ su<br />
암호:<br />
[root@happyjung happyjung]#&nbsp;<br />
<br />
<br />
<strong><span style="font-size:15px;">7.</span></strong> ssh 프로그램으로 root 접속확인<br />
접속이 안되는지 확인합니다.<br />
<br />
<br />
<br />
참고자료<br />
<a href="https://overcode.tistory.com/entry/리눅스-Root-계정-SSH-직접-접속-막기-CentOS-76" target="_blank">https://overcode.tistory.com/entry/리눅스-Root-계정-SSH-직접-접속-막기-CentOS-76</a>]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Mon, 18 Nov 2024 15:45:08 +0900</dc:date>
</item>


<item>
<title>[ForkLift] 폴더 새로고침</title>
<link>https://www.happyjung.com/lecture/3295</link>
<description><![CDATA[ForkLift 는 원격서버 연결후 변경된 정보가 바로 반영되지 않습니다.<br />
이때는 Command(⌘) + r 을 클릭하면 폴더 새로고침이 작동합니다.<br />
<br />
<br />
참고자료<br />
<a href="https://www.reddit.com/r/macapps/comments/12fkudv/forklift_binarynights_problem_with_refreshing/?rdt=52110" target="_blank">https://www.reddit.com/r/macapps/comments/12fkudv/forklift_binarynights_problem_with_refreshing/?rdt=52110</a>]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 15 Nov 2024 16:45:40 +0900</dc:date>
</item>


<item>
<title>보안서버는 무엇이고, 구축하지 않으면 어떻게 되나요?</title>
<link>https://www.happyjung.com/lecture/3294</link>
<description><![CDATA[보안인증서(SSL)는 개인 PC와 사이트 간의 통신을 암호화하여 개인정보 유출을 방지하는 보안 서비스로,&nbsp;<br />
보안서버가 구축되지 않은 사이트는 최대 3천만 원 이하의 과태료 등 행정 조치가 이루어질 수 있습니다.<br />
<br />
<br />
<strong>&lt;정보통신망 이용촉진 및 정보보호 등에 관한 법률&gt;</strong>의 개정으로<br />
영리를 목적으로 개인정보를 수집하는 모든 온라인 사업자들에 대해 보안서버 구축이 의무되었으며,<br />
2012년 8월 18일부터는 그 개정된 정보통신망법이 본격 시행되어, <strong>보안서버 미설치 시에는 처벌 대상</strong>이 됩니다.<br />
<br />
&nbsp;<br />
보안서버를 구축하지 않고 개인정보를 수집하는 온라인 사이트에는 <strong>3000만 원 이하의 과태료</strong>가 부과됩니다.<br />
또한, 2010년부터 꽤 오랜 준비기간이 주어졌기 때문에 적발된 사이트는 과태료뿐만 아니라 사이트의<br />
이미지 추락 우려가 있습니다.<br />
<br />
<br />
<strong>● 보안인증서는 무엇인가요?</strong><br />
<br />
SSL보안인증 (SSL: Secure Sokets Layer) 이란,<br />
개인정보, 비밀번호 등등의 개인정보를 취급할 때 <strong>이 정보를 암호화하여 전송하는 방식</strong>이라고 보시면 됩니다.<br />
<br />
예를들어 보안인증서가 구축되어있는 사이트에 로그인 시 아이디 및 비밀번호를 <strong>256bit로 암호화</strong>시켜 전송함으로써,<br />
아이디와 비밀번호가 연결 중간에 유출이 된다 하더라도 고객의 개인정보는 암호화되어 있음에 따라 안전하게 보호해줍니다.<br />
<br />
이에 따라 보안인증서를 사용하지 않고 서비스를 제공하는 경우에는 누군가가 고객이 홈페이지 로그인시<br />
비밀번호를 입력했을 때,<br />
비밀번호를 가로채가면 해당 정보가 암호화 되어 있지 않아 그대로 해커들에게 노출될 가능성이 있는 것입니다.<br />
<br />
다만, 보안 접속시에는 암호화하기 위한 시간이 추가적으로 필요하므로, 일반 접속시보다 조금 더 시간이 걸릴 수 있습니다.<br />
또한, 접속 중간 중간에 보안 설정에 대한 안내창이 뜰 수 있습니다.<br />
<br />
SSL 보안인증은 서버와 클라이언트 간의 통신시에 데이터를 암호화하여 전송하는 것이기 때문에,<br />
해커가 고객님의 비밀번호를 다른 방법으로 알아내어 DB에 접근했을 때 DB가 암호화 되어있지 않은 경우에는<br />
SSL보안을 사용하고 계시더라도 DB의 정보가 노출될 수 있습니다.<br />
<br />
<strong>보안서버를 구축하면</strong> &ldquo;이 사이트는 보안서버를 적용한 신뢰할 수 있는 사이트&rsquo;라는 표시로 <strong>Trust Logo</strong>를 부착할 수 있습니다.<br />
또, <strong>보안이 적용된 웹사이트라는 표시</strong>로 접속주소가 &lsquo;http://&rsquo; 대신 &lsquo;<strong>https://</strong>&rsquo;로 시작하며 웹 브라우저 하단에 자물쇠 아이콘이 표시됩니다.<br />
<br />
<strong>&lsquo;https://&rsquo;와 자물쇠 아이콘</strong>으로 충분히 고객들에게 신뢰받는 사이트가 될 수 있습니다.]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Wed, 06 Nov 2024 18:48:03 +0900</dc:date>
</item>


<item>
<title>[G5.4] 추가배송비 수정하기</title>
<link>https://www.happyjung.com/lecture/3293</link>
<description><![CDATA[추가배송비 관련해서 필요해서 찾아보니, 추가배송비 데이타를 등록하도록 해주는 좋은 기능을 공개해주셔서 감사합니다.<br />
<a href="https://sir.kr/yc5_skin/1195" target="_blank">https://sir.kr/yc5_skin/1195</a><br />
<br />
추가배송비 수정하는 기능을 구현해서 사용하니 좋아서 공유합니다.<br />
<br />
ChatGPT 도움을 받아서 만들었습니다.<br />
<br />
<br />
&lt;&lt; <strong><span style="font-size:16px;">변경전</span></strong> &gt;&gt;<br />
<br />
<img alt="" src="https://happyjung.diskn.com/data/lecture/youngcart_sendcost_20241021_1.png" /><br />
<br />
<br />
&lt;&lt; <span style="font-size:16px;"><strong>변경후</strong></span> &gt;&gt;<br />
<br />
<img alt="" src="https://happyjung.diskn.com/data/lecture/youngcart_sendcost_20241021_2.png" /><br />
<br />
<br />
<span style="font-size:16px;"><strong>1.</strong></span> adm / shop_admin / sendcost_list.php 내용에서<br />
<br />
<br />
<span style="font-size:16px;"><strong>1-1.</strong></span> 내용 변경<br />
// 등록된 배송비 목록이 이름순서로 표시되도록 변경<br />
<br />
$sql_order = &quot; order by sc_id desc &quot;;<br />
<br />
를 아래와 같이 수정 변경<br />
<br />
//$sql_order = &quot; order by sc_id desc &quot;;<br />
$sql_order = &quot; order by sc_name asc &quot;;<br />
<br />
<br />
<span style="font-size:16px;"><strong>1-2.</strong></span> 내용 변경<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th scope=&quot;col&quot;&gt;지역명&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th scope=&quot;col&quot;&gt;우편번호&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th scope=&quot;col&quot;&gt;추가배송비&lt;/th&gt;<br />
<br />
를 아래와 같이 수정 변경<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th scope=&quot;col&quot;&gt;우편번호&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th scope=&quot;col&quot;&gt;추가배송비&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th scope=&quot;col&quot;&gt;지역명&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th scope=&quot;col&quot;&gt;수정&lt;/th&gt;<br />
<br />
<br />
<span style="font-size:16px;"><strong>1-3.</strong></span> 내용 변경<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;td_left&quot;&gt;&lt;?php echo $row[&#39;sc_name&#39;]; ?&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;td_postalbig&quot;&gt;&lt;?php echo $row[&#39;sc_zip1&#39;].&#39; ~ &#39;.$row[&#39;sc_zip2&#39;]; ?&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;td_sendcost_add&quot;&gt;&lt;?php echo number_format($row[&#39;sc_price&#39;]); ?&gt;&lt;/td&gt;<br />
<br />
를 아래와 같이 수정 변경<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;td_postalbig&quot;&gt;&lt;?php echo $row[&#39;sc_zip1&#39;].&#39; ~ &#39;.$row[&#39;sc_zip2&#39;]; ?&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;td_sendcost_add&quot;&gt;&lt;?php echo number_format($row[&#39;sc_price&#39;]); ?&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;td_left&quot;&gt;&lt;?php echo $row[&#39;sc_name&#39;]; ?&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;td_sendcost_add&quot;&gt;&lt;a href=&quot;./sendcost_edit.php?sc_id=&lt;?php echo $row[&#39;sc_id&#39;]; ?&gt;&quot; onclick=&quot;window.open(this.href, &#39;sendcost_edit&#39;, &#39;width=600,height=350,scrollbars=yes&#39;); return false;&quot; class=&quot;btn btn_03&quot;&gt;수정&lt;/a&gt;&lt;/td&gt;<br />
<br />
<br />
<strong><span style="font-size:16px;">1-4.</span></strong> 내용 변경<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#39;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;empty_table&quot;&gt;자료가 없습니다.&lt;/td&gt;&lt;/tr&gt;&#39;;<br />
<br />
를 아래와 같이 수정 변경<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#39;&lt;tr&gt;&lt;td colspan=&quot;5&quot; class=&quot;empty_table&quot;&gt;자료가 없습니다.&lt;/td&gt;&lt;/tr&gt;&#39;;<br />
<br />
<br />
<strong><span style="font-size:16px;">2.</span></strong> adm / shop_admin / sendcost_edit.php 파일 생성<br />
&lt;?php<br />
$sub_menu = &#39;400750&#39;;<br />
include_once(&#39;./_common.php&#39;);<br />
<br />
auth_check($auth[$sub_menu], &quot;r&quot;);<br />
<br />
// Get the sc_id from the query parameter<br />
$sc_id = isset($_GET[&#39;sc_id&#39;]) ? (int)$_GET[&#39;sc_id&#39;] : 0;<br />
if ($sc_id === 0) {<br />
&nbsp; &nbsp; echo &quot;Invalid access.&quot;;<br />
&nbsp; &nbsp; exit;<br />
}<br />
<br />
// Fetch the existing data for the selected sc_id<br />
$sql = &quot;SELECT * FROM `{$g5[&#39;g5_shop_sendcost_table&#39;]}` WHERE sc_id = &#39;{$sc_id}&#39;&quot;;<br />
$row = sql_fetch($sql);<br />
<br />
if (!$row) {<br />
&nbsp; &nbsp; echo &quot;No data found.&quot;;<br />
&nbsp; &nbsp; exit;<br />
}<br />
<br />
// Update process<br />
if ($_SERVER[&#39;REQUEST_METHOD&#39;] == &#39;POST&#39;) {<br />
&nbsp; &nbsp; $sc_name = $_POST[&#39;sc_name&#39;];<br />
&nbsp; &nbsp; $sc_zip1 = $_POST[&#39;sc_zip1&#39;];<br />
&nbsp; &nbsp; $sc_zip2 = $_POST[&#39;sc_zip2&#39;];<br />
&nbsp; &nbsp; $sc_price = $_POST[&#39;sc_price&#39;];<br />
<br />
&nbsp; &nbsp; // Update query<br />
&nbsp; &nbsp; $sql = &quot;UPDATE `{$g5[&#39;g5_shop_sendcost_table&#39;]}`<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET sc_name = &#39;{$sc_name}&#39;, sc_zip1 = &#39;{$sc_zip1}&#39;, sc_zip2 = &#39;{$sc_zip2}&#39;, sc_price = &#39;{$sc_price}&#39;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE sc_id = &#39;{$sc_id}&#39;&quot;;<br />
&nbsp; &nbsp; sql_query($sql);<br />
<br />
&nbsp; &nbsp; // Close the window and refresh the parent page<br />
&nbsp; &nbsp; echo &quot;&lt;script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; alert(&#39;수정이 완료되었습니다.&#39;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; opener.location.reload();<br />
&nbsp; &nbsp; &nbsp; &nbsp; window.close();<br />
&nbsp; &nbsp; &lt;/script&gt;&quot;;<br />
&nbsp; &nbsp; exit;<br />
}<br />
<br />
$g5[&#39;title&#39;] = &#39;추가배송비 수정&#39;;<br />
<br />
include_once(G5_PATH.&#39;/head.sub.php&#39;);<br />
?&gt;<br />
<br />
&lt;section id=&quot;sendcost_postal&quot;&gt;<br />
&nbsp; &nbsp; &lt;h2&gt;추가배송비 수정&lt;/h2&gt;<br />
<br />
&nbsp;&nbsp; &nbsp;&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class=&quot;tbl_frm01 tbl_wrap&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;table&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;caption&gt;추가배송비 등록&lt;/caption&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;colgroup&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;col class=&quot;grid_4&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;col&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/colgroup&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tbody&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;th scope=&quot;row&quot;&gt;지역명&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;sc_name&quot; value=&quot;&lt;?php echo $row[&#39;sc_name&#39;]; ?&gt;&quot; size=&quot;30&quot; required class=&quot;required frm_input&quot;&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;th scope=&quot;row&quot;&gt;우편번호 시작&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;sc_zip1&quot; value=&quot;&lt;?php echo $row[&#39;sc_zip1&#39;]; ?&gt;&quot; size=&quot;10&quot; required class=&quot;required frm_input&quot;&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;th scope=&quot;row&quot;&gt;우편번호 끝&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;sc_zip2&quot; value=&quot;&lt;?php echo $row[&#39;sc_zip2&#39;]; ?&gt;&quot; size=&quot;10&quot; required class=&quot;required frm_input&quot;&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;th scope=&quot;row&quot;&gt;추가배송비&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;sc_price&quot; value=&quot;&lt;?php echo $row[&#39;sc_price&#39;]; ?&gt;&quot; size=&quot;8&quot; required class=&quot;required frm_input&quot;&gt; 원&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/tbody&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/table&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/div&gt;<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;div class=&quot;btn_confirm01 btn_confirm&quot; style=&quot;text-align:center;&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;input type=&quot;submit&quot; value=&quot;확인&quot; class=&quot;btn_submit btn&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/div&gt;<br />
<br />
&nbsp; &nbsp; &lt;/form&gt;<br />
&lt;/section&gt;<br />
<br />
&lt;?php<br />
include_once(G5_PATH.&#39;/tail.sub.php&#39;);]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Mon, 21 Oct 2024 13:44:53 +0900</dc:date>
</item>


<item>
<title>[LG유플러스/토스페이먼츠] XPay 도메인 지원종료 안내</title>
<link>https://www.happyjung.com/lecture/3292</link>
<description><![CDATA[토스페이먼츠 공지메일이 2024.09.03 11:26 수신되어 공유합니다.<br />
++++++++++++++++++++++++++++++++++++++++++++++++++++++<br />
<br />
안녕하세요. 토스페이먼츠입니다.&nbsp;<br />
귀사의 번영을 진심으로 기원하며 당사 결제 서비스를 지속적으로 이용해 주셔서 감사드립니다.<br />
<br />
당사는 귀사와의 협력 관계를 소중히 여기며, 항상 최상의 결제 서비스를 제공하기 위해 노력하고 있습니다.<br />
이에, 중요한 소식을 알려드리고자 합니다.<br />
<br />
토스페이먼츠는 LG U+ 의 PG 사업 부문을 인수하였으며, 인수계약에 따라 LG U+ 소유의 도메인 이용이 만료될 예정 입니다. 이에 2024년 12월 31일 부터는 LG U+ 도메인을 통한 서비스 제공이 종료될 예정임을 안내 드립니다.<br />
&nbsp;<br />
**지원 종료 일자: 2024년 12월 31일**<br />
귀사는 위 일정을 고려하여 주시고, 당사가 위 종료일자 이후에도 귀사에 결제 서비스를 안정적으로 제공할 수 있도록, LG U+ 소유의 도메인을 토스페이먼츠 소유의 도메인으로 변경하여 주시기 바랍니다.<br />
<br />
변경 방법<br />
<br />
1) (결제창 호출) crossplatform.js 파일의 주소가 아래 주소를 바라보도록 변경합니다<br />
https://xpay.tosspayments.com/xpay/js/xpay_crossplatform.js<br />
<br />
2) (API 호출) lgdacom.conf 파일을 열고 Gateway.do 호출시 사용되는 **url** 도메인을&nbsp;<br />
https://xpay-gateway.tosspayments.com/xpay/Gateway.do 로 변경합니다.<br />
<br />
*test_url 은 테스트 환경 설정입니다. 필요 시 별도 연락 부탁 드립니다.<br />
*aux_url 은 사용 되지 않습니다. 삭제 하셔도 무방 합니다.<br />
<br />
2-1) 방화벽을 운영하는 경우 토스페이먼츠의 새로운 DNS(IP)를 허용합니다.<br />
<br />
210.98.141.15:443/TCP<br />
210.98.141.16:443/TCP<br />
103.182.250.5:443/TCP<br />
103.182.251.5:443/TCP<br />
<br />
&nbsp;<br />
아래 서비스를 이용하고 있으실 경우, 요청 도메인을 https://pgweb.tosspayments.com 으로 변경 합니다.<br />
- /WEB_SERVER/js/escrowValid.js (에스크로 이용확인)<br />
- /pg/wmp/mertadmin/jsp/mertservice/escrowValid.js (에스크로 이용확인)<br />
- /WEB_SERVER/escrow/escrowValid.js (에스크로 이용확인)<br />
- /WEB_SERVER/js/receipt_link.js (매출전표 및 영수증 출력)<br />
- /pg/wmp/outerpage/trxdown.jsp (거래대사,정산대사)<br />
<br />
변경 후<br />
- https://pgweb.tosspayments.com/WEB_SERVER/js/escrowValid.js<br />
- https://pgweb.tosspayments.com/pg/wmp/mertadmin/jsp/mertservice/escrowValid.js<br />
- https://pgweb.tosspayments.com/WEB_SERVER/escrow/escrowValid.js<br />
- https://pgweb.tosspayments.com/WEB_SERVER/js/receipt_link.js<br />
- https://pgweb.tosspayments.com/pg/wmp/outerpage/trxdown.jsp<br />
<br />
&nbsp;<br />
변경 과정에서 발생할 수 있는 불편함에 대해 사전에 양해를 구하며, 본 안내 내용과 관련하여 도움이 필요하신 경우, 언제든 저희에게 연락 주시기 바랍니다.<br />
<br />
- 이메일: techsupport@tosspayments.com<br />
- 디스코드: https://developers.tosspayments.com/go/techchat<br />
<br />
귀사의 비즈니스에 최적화된 결제 환경을 제공하기 위해 적극적인 협조를 부탁드립니다.<br />
항상 귀사의 성공을 응원하며, 앞으로도 변함없는 파트너십을 이어나가길 기대합니다.<br />
<br />
감사합니다.]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Thu, 05 Sep 2024 09:30:21 +0900</dc:date>
</item>


<item>
<title>MySQL vs. mariaDB 호환성</title>
<link>https://www.happyjung.com/lecture/3288</link>
<description><![CDATA[SELECT VERSION()<br />
5.7.23-log &nbsp; &lt;&lt;==&nbsp;MySQL<br />
10.6.5-MariaDB-log &nbsp;&lt;&lt;==&nbsp;MariaDB<br />
<br />
MySQL 5.1 = MariaDB 5.1<br />
MySQL 5.1 = MariaDB 5.2<br />
MySQL 5.1 = MariaDB 5.3<br />
<br />
MySQL 5.5 = MariaDB 5.5<br />
MySQL 5.5 = MariaDB 10.0<br />
<br />
MySQL 5.6 = MariaDB 10.1<br />
<br />
MySQL 5.7 = MariaDB 10.2<br />
<br />
MySQL 8.0 = MariaDB 10.3<br />
MySQL 8.0 = MariaDB 10.4<br />
<br />
<br />
참고자료<br />
<a href="http://dbtech.co.kr/bbs/?bo_c=1140&amp;bo_v=545" target="_blank">http://dbtech.co.kr/bbs/?bo_c=1140&amp;bo_v=545</a><br />
&nbsp;]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 29 Mar 2024 14:14:15 +0900</dc:date>
</item>


<item>
<title>홈페이지를 특정 IP 일때 다른 페이지로 연결하기</title>
<link>https://www.happyjung.com/lecture/3283</link>
<description><![CDATA[그누보드 홈페이지를 특정 IP 일때는 다른 페이지로 연결(redirect)하는 방법입니다.<br />
홈페이지 리뉴얼 중이거나, 특정 IP 접속자를 차단하는 용도로도 사용이 가능합니다.<br />
<br />
<br />
<span style="font-size:15px;"><strong>1.</strong></span> 연결될 페이지 또는 URL 준비<br />
<br />
<br />
<br />
<strong><span style="font-size:15px;">2.</span></strong> 그누보드 / extend / hp5_ip.php &nbsp;파일 생성<br />
&lt;?php<br />
if (!defined(&#39;_GNUBOARD_&#39;)) exit;<br />
<br />
if(!function_exists(&quot;hpRealUserIP&quot;))&nbsp;<br />
{<br />
&nbsp;&nbsp; &nbsp;function hpRealUserIP()<br />
&nbsp;&nbsp; &nbsp;{<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;// Get real visitor IP behind CloudFlare network<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (isset($_SERVER[&quot;HTTP_CF_CONNECTING_IP&quot;])) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;$_SERVER[&#39;REMOTE_ADDR&#39;] = $_SERVER[&quot;HTTP_CF_CONNECTING_IP&quot;];<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;$_SERVER[&#39;HTTP_CLIENT_IP&#39;] = $_SERVER[&quot;HTTP_CF_CONNECTING_IP&quot;];<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$client &nbsp;= @$_SERVER[&#39;HTTP_CLIENT_IP&#39;];<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$forward = @$_SERVER[&#39;HTTP_X_FORWARDED_FOR&#39;];<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$remote &nbsp;= $_SERVER[&#39;REMOTE_ADDR&#39;];<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(filter_var($client, FILTER_VALIDATE_IP))<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$ip = $client;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;elseif(filter_var($forward, FILTER_VALIDATE_IP))<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$ip = $forward;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$ip = $remote;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />
<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return $ip;<br />
&nbsp;&nbsp; &nbsp;}<br />
}<br />
<br />
$hp_real_ip = hpRealUserIP();<br />
<br />
if ($hp_real_ip == &#39;IP1&#39; || $hp_real_ip == &#39;IP2&#39; || $hp_real_ip == &#39;IP3&#39;)<br />
{<br />
&nbsp;&nbsp; &nbsp;// 정상페이지 보여줌<br />
}<br />
else<br />
{<br />
&nbsp;&nbsp; &nbsp;// 작업중 페이지 보여줌<br />
&nbsp;&nbsp; &nbsp;goto_url(&quot;/index2.php&quot;);<br />
}]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 23 Feb 2024 18:40:48 +0900</dc:date>
</item>


<item>
<title>2개 이상의 button 누르면 각 ifrme 으로 페이지 열기</title>
<link>https://www.happyjung.com/lecture/3281</link>
<description><![CDATA[버튼 2개에 각각 iframe 으로 url 을 전송해서 페이지를 여는 방법입니다.<br />
&nbsp;<br />
&lt;script src=&quot;//code.jquery.com/jquery-latest.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;button type=&quot;button&quot; id=&quot;bntPostYourAdd1&quot;&gt;다음&lt;/button&gt;<br />
&lt;button type=&quot;button&quot; id=&quot;bntPostYourAdd2&quot;&gt;카카오 캘린더&lt;/button&gt;<br />
&lt;br&gt;&lt;br&gt;<br />
&lt;iframe id=&quot;forPostyouradd1&quot; data-src=&quot;https://daum.net&quot;&nbsp;<br />
&nbsp; &nbsp; src=&quot;about:blank&quot; width=&quot;500&quot; height=&quot;300&quot; style=&quot;background-color:coral&quot;&gt;<br />
&lt;/iframe&gt;<br />
&lt;script&gt;<br />
&nbsp; &nbsp; function postYourAdd1() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; var iframe = $(&quot;#forPostyouradd1&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; iframe.attr(&quot;src&quot;, iframe.data(&quot;src&quot;));&nbsp;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; $(&quot;#bntPostYourAdd1&quot;).on(&quot;click&quot;, postYourAdd1);<br />
&lt;/script&gt;<br />
<br />
&lt;iframe id=&quot;forPostyouradd2&quot; data-src=&quot;https://map.kakao.com&quot;&nbsp;<br />
&nbsp; &nbsp; src=&quot;about:blank&quot; width=&quot;500&quot; height=&quot;300&quot; style=&quot;background-color:aqua&quot;&gt;<br />
&lt;/iframe&gt;<br />
&lt;script&gt;<br />
&nbsp; &nbsp; function postYourAdd2() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; var iframe = $(&quot;#forPostyouradd2&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; iframe.attr(&quot;src&quot;, iframe.data(&quot;src&quot;));&nbsp;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; $(&quot;#bntPostYourAdd2&quot;).on(&quot;click&quot;, postYourAdd2);<br />
&lt;/script&gt;<br />
<br />
샘플 : <a href="http://happyjung.com/demo/javascript/button_iframe.php" target="_blank">http://happyjung.com/demo/javascript/button_iframe.php</a><br />
&nbsp;<br />
<br />
참고자료<br />
<a href="https://inpa.tistory.com/entry/open-iframe-on-button-click-Code" target="_blank">https://inpa.tistory.com/entry/open-iframe-on-button-click-Code</a><br />
<a href="https://sir.kr/qa/525654" target="_blank">https://sir.kr/qa/525654</a>]]></description>
<dc:creator>관리자1</dc:creator>
<dc:date>Fri, 16 Feb 2024 18:50:29 +0900</dc:date>
</item>

</channel>
</rss>
