인터넷익스플로러에서 링크가 이상하게작동합니다.
관련링크
본문
문의하기 버튼을 누르면 메인index.php 에서는 정상적으로 작동하는데, 다른 페이지에서는 링크가 이상하게 이동됩니다.
크롬에서는 정상적으로 작동하는데, 익스플로러에서만 아래 그림처럼 링크가 이동되네요..
문의하기 버튼의 링크는
<a href="" onclick="MM_openBrWindow('http://kofststp.or.kr/formmail.php','','width=768,height=680')">
이렇게 되어있습니다.
formmail.php 은
<?php
include_once('./_common.php');
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<title>과학기술정책 전문인력 육성 지원 사업</title>
<link rel="stylesheet" href="<?php echo G5_URL?>/css/science_tech.css" type="text/css" />
</head>
<body>
<div class="qna_pac">
<div class="qna_h1">문의하기</div>
<form name="contactform" method="post" action="send.php">
<table class="news_table2" cellpadding="0" cellspacing="0">
<colgroup>
<col width="150px" />
<col width="" />
<col width="120px" />
<col width="120px" />
</colgroup>
<tr>
<th for="first_name">제목</th>
<td class="title"><input name="first_name" type="text" class="input_style2" required ></td>
</tr>
<tr>
<th for="email">답변 받으실 이메일</th>
<td><input name="email" type="text" class="input_style2" required ></td>
</tr>
<tr>
<td colspan="2" style="padding:10px 0 10px 0; text-align:left;"><textarea name="comments" class="txt_style"></textarea></td>
</tr>
</table>
<div class="qna_btn"><input type="image" name="submit" value="전송하기" src="<?php echo G5_URL?>/images/btn_qna.png"></div>
</form>
</div>
formmail.php 에서 사용하는 send.php 내용입니다
<meta charset="utf-8">
<?php
if(isset($_POST['email'])) {
$email_to = "*** 개인정보보호를 위한 이메일주소 노출방지 ***";
$email_subject = "문의사항입니다.";
$email_subject = '=?UTF-8?B?'.base64_encode($email_subject).'?=';
function died($error) {
// your error code can go here
echo "<script> alert('메일발송을 실패하였습니다.');";
echo "history.go(-1);";
echo "</script>";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['email']) ||
//!isset($_POST['telephone']) ||
!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$first_name = $_POST['first_name']; // required
$email_from = $_POST['email']; // required
//$telephone = $_POST['telephone']; // not required
$comments = $_POST['comments']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "제목 : ".clean_string($first_name)."\n\n";
$email_message .= "이메일 : ".clean_string($email_from)."\n\n";
//$email_message .= "연락처 : ".clean_string($telephone)."\n\n";
$email_message .= "문의사항 : ".clean_string($comments)."\n\n";
// create email headers
$headers = 'From: '.$email_from;
// 제목이 깨질경우 아래 캐릭터셋 적용
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
<script>
alert ("메일이 발송되었습니다.\n빠른 시일안에 답변드리겠습니다.");
window.close();
</script>
<?php
}
?>
답변 6
해당 폴더의 퍼미션 user,group,other에 r(읽기)w(쓰기)x(실행)주는 곳에 777로 되어 있는 경우 홈페이지 폴더에 접근하면 인터넷익스플로어에서 파일목록이 보이게 됩니다. 해당 폴더의 퍼미션 문제이니 다른 폴더도 그럴 수 있으니 확인하여 퍼미션을 755이하로 변경해주세요.
ssh로 접속하여 chmod 755 bbs 로 하여 변경하거나 ftp로 폴더 권한 변경하세요.
<a href="" onclick="MM_openBrWindow('','','width=768,height=680')">
요기서 href="" 를 삭제하거나 href="#" 을 함 줘보세요. 경로 문제같은데
원인은 두째치고 해당 글을 재 수정하셔야 할듯..
php 소스 다 보입니다. 보안 어쩌시려고요???
제 댓글에 다시 코멘틀를 다셔서 저도 삭제가 안됩니다.
httpd.conf 에서 아래 같은 설정에서 Indexes 삭제하시고 httpd 재시작하세요.
< Directory "/home/*/public_html">
~
Options Indexes FollowSymLinks <- Options FollowSymLinks
~
< /Directory>
아파치 재시작이 불가능하면
그누보드설치된 폴더에 .htaccess 파일 만드시고 아래 내용 써주세요.
Options -Indexes