질문좀요

질문좀요

QA

질문좀요

답변 1

본문

123.php 파일이 

아래의 코드를 가지고 있을경우 abc123.com/123.php 브라우저 실행시 자동으로 글 등록 되도록 가능할까요?

 


<?php
include_once('./_common.php');
$g5['title'] = "게시글 이동 등록";
include_once(G5_PATH.'/head.php');
?>
<header class="selector">
<form name="hquery" action="scrap_action.php" method="post">
  <section style="margin:20px 0">
  <p><label style="font-weight:700;width:120px;display:inline-block;">스크랩할 URL: </label><input type="url" name="url" value="<?php echo htmlspecialchars(@$url, ENT_QUOTES);?>" placeholder="예. https://365ok.co.kr" autofocus class="frm_input half_input  <?php echo $required ?>" required></p>
  <p><label style="font-weight:700;width:120px;display:inline-block;">입력할 게시판명: </label><input type="text" name="bo_table" value="<?php echo htmlspecialchars(@$bo_table, ENT_QUOTES);?>" placeholder="예. humor" class="frm_input half_input <?php echo $required ?>" required></p>
  </section>
  <p>** ftp정보를 root.php 정보에서 입력하셔야 게시글 등록이 가능 합니다.</p>
<section style="margin:20px 0">
  <p><label style="font-weight:700;width:120px;display:inline-block;">목록 Selector: </label><input type="text" name="sel" value="<?php echo htmlspecialchars(@$sel, ENT_QUOTES);?>" placeholder="예. table.tb_list" class="frm_input half_input <?php echo $required ?>" required></p>
  <p><label style="font-weight:700;width:120px;display:inline-block;">목록 제목 Selector: </label><input type="text" name="sel12" value="<?php echo htmlspecialchars(@$sel12, ENT_QUOTES);?>" placeholder="예. table.list_title" class="frm_input half_input <?php echo $required ?>" required></p>
</section>
<section style="margin:20px 0">
  <p><label style="font-weight:700;width:120px;display:inline-block;">글보기 Selector: </label><input type="text" name="sel2" value="<?php echo htmlspecialchars(@$sel2, ENT_QUOTES);?>" placeholder="예. div#container" class="frm_input half_input <?php echo $required ?>"  required></p>
  <p><label style="font-weight:700;width:120px;display:inline-block;">글보기 제목 Selector: </label><input type="text" name="sel22" value="<?php echo htmlspecialchars(@$sel22, ENT_QUOTES);?>" placeholder="예. div#title" class="frm_input half_input <?php echo $required ?>" required></p>
  <p><label style="font-weight:700;width:120px;display:inline-block;">글보기 내용 Selector: </label><input type="text" name="sel23" value="<?php echo htmlspecialchars(@$sel23, ENT_QUOTES);?>" placeholder="예. div#content" class="frm_input half_input <?php echo $required ?>" required></p>
</section>
  <p>
      <button type="submit" name="go" value="elements" class="btn btn_submit">스크래핑하기</button>
  </p>
</form>
</header>

<?php
  include_once(G5_PATH.'/tail.php');
?>

이 질문에 댓글 쓰기 :

답변 1


<?php 
    $bo_table = "free";
    $write_table = $g5['write_prefix'].$bo_table;
    $wr_num = get_next_num($write_table);
    $wr_reply = "";
    $ca_name = "카테고리";
    $wr_subject = "글쓰기 제목 설정";
    $wr_content = "본문내용 입력";
    $sql = " insert into {$write_table}
         set wr_num = '{$wr_num}',
        wr_reply = '{$wr_reply}',
        wr_comment = '0',
        ca_name = '{$ca_name}',
        wr_option = '{$wr_option}',
        wr_subject = '{$wr_subject}',
        wr_content = '{$wr_content}',
        wr_seo_title = '{$wr_seo_title}',
        wr_link1 = '{$wr_link1}',
        wr_link2 = '{$wr_link2}',
        wr_link1_hit = '0',
        wr_link2_hit = '0',
        wr_hit = '0',
        wr_good = '0',
        wr_nogood = '0',
        mb_id = '".$member['mb_id']."',
        wr_password = '{$wr_password}',
        wr_name = '{$wr_name}',
        wr_email = '{$wr_email}',
        wr_homepage = '{$wr_homepage}',
        wr_datetime = '".G5_TIME_YMDHIS."',
        wr_last = '".G5_TIME_YMDHIS."',
        wr_ip = '".$_SERVER['REMOTE_ADDR']."',
        as_img = '{$as_img}',
        wr_1 = '{$wr_1}',
        wr_2 = '{$wr_2}',
        wr_3 = '{$wr_3}',
        wr_4 = '{$wr_4}',
        wr_5 = '{$wr_5}',
        wr_6 = '{$wr_6}',
        wr_7 = '{$wr_7}',
        wr_8 = '{$wr_8}',
        wr_9 = '{$wr_9}',
        wr_10 = '{$wr_10}' ";
    sql_query($sql);
?>


원하는 곳에 위의 내용을 가져오면 자동으로 글쓰기 됩니다.
필요한 항목은 맞추어 넣어야 할 것입니다.
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 125,873
© SIRSOFT
현재 페이지 제일 처음으로