File name: welboard2/write.wel (2,222 bytes) Text file viewer v1.2
    1 : #!/bin/wel
    2 : 
    3 : /* file: write.wel
    4 : 
    5 :    게시판 글 쓰기 프로그램 (author: 서광현)
    6 : 
    7 :    Copyright (c) 2001/03/25 by Wesoft
    8 :    All Rights Reserved.
    9 : */
   10 : 
   11 : send_cookie= "NO";
   12 : if(include("include/fileupload.sub")!=OK) return;
   13 : if(read_only==1)
   14 :  {
   15 :     if(attfile!="") delete_uploadfile();
   16 :     MSG1= "관리자 전용 " ~ prg_title;
   17 :     if(board_name=="") board_name= "이 " ~ prg_title;
   18 :     MSG2= "<font color=#0000c0>" ~ board_name ~ "</font>에서는 "
   19 :         ~ "관리자만 쓰기/수정/삭제를 할 수 있습니다!" ~ BACK_BUTTON;
   20 :     formdump(message_form);
   21 :     return disconnect();
   22 :  }
   23 : if(writeflag<1)
   24 :  {
   25 :     if(attfile!="") delete_uploadfile();
   26 :     action= "write.wel", answer_flag= "";
   27 :     wname= ckname, wemail= ckemail;
   28 :     if(wname=="") focus= "wname";
   29 :      else if(wemail=="") focus= "wemail";
   30 :       else focus= "subject";
   31 :     fm= formdump(skin~"write.fom");
   32 :     if(fm==FORM_OPENERR) return err_form("write.fom");
   33 :     return disconnect();
   34 :  }
   35 : 
   36 : subject= strchange(left(lrtrim(subject),60,1), fch, rch);
   37 : content= strchange(content, fch, rch);
   38 : fileseq= val(new_attfile);
   39 : linecnt= strcount(content, "\n");
   40 : if(right(content,1)!="\n") ++linecnt;
   41 : postpass= encode(left(postpass, 12), encodekey(), "", decode_variable);
   42 : 
   43 : wdtime= date(1) ~ " " ~ left(time(1),5);
   44 : wip= getenv("REMOTE_ADDR");
   45 : whost= getenv("REMOTE_HOST");
   46 : wname= strchange(left(lrtrim(wname),20,1), fch, rch);
   47 : wemail= strchange(left(lrtrim(wemail),40,1), fch, rch);
   48 : grpno= selno= get_maximum(mytable, "selno", "") + 1;
   49 : 
   50 : qstr= "insert into " ~ mytable
   51 :     ~ " (selno,grpno,answer,subject,content,attfile,fileseq,readcnt,downcnt,"
   52 :     ~ "linecnt,postpass,wdtime,wip,whost,wname,wemail) values ("
   53 :     ~ strform("{$selno},{$grpno},'','{$subject}','{$content}','{$attfile}',",
   54 :               "{$fileseq},0,0,{$linecnt},'{$postpass}','{$wdtime}','{$wip}',",
   55 :               "'{$whost}','{$wname}','{$wemail}')");
   56 : 
   57 : if(mysql_query(mysql, qstr)==MYSQL_ERR)
   58 :  {
   59 :     if(attfile!="") delete_uploadfile();
   60 :     return err_query();
   61 :  }
   62 : send_cookie(ckid, ckpass, wemail, wname);
   63 : if(mail_to_admin!=0) include("include/mailadmin.sub");
   64 : vn= get_recount(mytable, "");
   65 : url= strform("view.wel?db={$db}&pg=1&sk={$sk}&no={$selno}&vn={$vn}&k=&cn={$cn}&cs={$cs}&cc={$cc}&nc=1");
   66 : replace_location(url);
   67 : return disconnect();
File name: welboard2/write.wel (2,222 bytes) Wesoft Corp. ⓒ 2001 All rights reserved.