<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr align="center"> <td height="1" colspan="2" class="bgcolor05"></td> </tr> <tr height="30"> <td style="padding-left:5px;">이름 : <?php echo $reply_name; ?> </td> <td align="right" style="padding-right:5px;"> 등록일 : <?php echo $reply_regdate; ?> <?php if ($reply_filename != "" && file_exists(get_real_filepath($filepath1) . "/" . $reply_filename)) { ?> | <a href="/common/download.php?filepath=<?php echo $filepath1; ?> &origin_filename=<?php echo $reply_origin_filename; ?> &filename=<?php echo $reply_filename; ?> "><?php echo $reply_origin_filename; ?> </a>
include_once $_SERVER['DOCUMENT_ROOT'] . "/common/lib/common.php"; $db = new DbMySqli(); $name = addslashes($_POST['name']); $title = addslashes($_POST['title']); $content = addslashes($_POST['content']); //첨부파일 업로드 if (is_uploaded_file($_FILES["filename"]["tmp_name"])) { $filename = $_FILES["filename"]["name"]; $filesize = $_FILES["filename"]["size"]; $origin_filename = $filename; $ext = strtolower(get_ext($filename)); new_check_ext($ext); //금지파일 체크 $filename = get_filename($filepath1, $ext); move_uploaded_file($_FILES["filename"]["tmp_name"], get_real_filepath($filepath1) . "/" . $filename); } else { $filesize = 0; } $userip = $_SERVER['REMOTE_ADDR']; $sql = "select ifnull(max(idx), 0) + 1 from tbl_qna"; $result = $db->query($sql); $rows = mysqli_fetch_row($result); $f_idx = $rows[0]; $table = "tbl_qna"; $idx_field = "idx"; $db['f_idx'] = $f_idx; $db['thread'] = "a"; $db['name'] = $name; $db['title'] = $title; $db['content'] = $content;
function delete_file($filepath, $filename) { if ($filename != "" && file_exists(get_real_filepath($filepath) . "/" . $filename)) { unlink(get_real_filepath($filepath) . "/" . $filename); } }