문의하기 버튼을 누르면 메인index.php 에서는 정상적으로 작동하는데, 다른 페이지에서는 링크가 이상하게 이동됩니다.
크롬에서는 정상적으로 작동하는데, 익스플로러에서만 아래 그림처럼 링크가 이동되네요..

문의하기 버튼의 링크는
<a href="" onclick="MM_openBrWindow('http://kofststp.or.kr/formmail.php','','width=768,height=680')">
이렇게 되어있습니다.
formmail.php 은
<?phpinclude_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"><?phpif(isset($_POST['email'])) { $email_to = "[email protected]"; $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개 / 댓글 9개
해당 폴더의 퍼미션 user,group,other에 r(읽기)w(쓰기)x(실행)주는 곳에 777로 되어 있는 경우 홈페이지 폴더에 접근하면 인터넷익스플로어에서 파일목록이 보이게 됩니다. 해당 폴더의 퍼미션 문제이니 다른 폴더도 그럴 수 있으니 확인하여 퍼미션을 755이하로 변경해주세요.
ssh로 접속하여 chmod 755 bbs 로 하여 변경하거나 ftp로 폴더 권한 변경하세요.
답변에 대한 댓글 7개
You don't have permission to access /bbs/ on this server.
이렇게 오류가 뜨고, 661로 변경하니까 문의하기 팝업은 작동하는데 기존 페이지에서
Forbidden
You don't have permission to access /bbs/ on this server.
가 뜹니다..ㅜㅜ 진짜..죄송합니다ㅜㅜㅜ
아래는 유형별 퍼미션 설정이니 서버에 맞는 것으로 설정하세요.
Umask 002
디렉토리허가권 775
파일 허가권 664
Umask 007
디렉토리허가권 770
파일 허가권 660
Umask020
디렉토리허가권 757
파일 허가권 646
Umask 070
디렉토리허가권 705
파일 허가권 604
Umask 022
디렉토리허가권 755
파일 허가권 644
pc의 쿠키 및 캐시, 임시파일 문제 일 수 있으니 브라우저 설정에서 삭제하고 삭제되면 창을 닫고 다시 접속해보세요.
초보자인 저에게 주기적인 피드백주셔서 정말 감사드립니다..!!
아파치 재시작이 불가능하면
그누보드설치된 폴더에 .htaccess 파일 만드시고 아래 내용 써주세요.
Options -Indexes
httpd.conf 에서 아래 같은 설정에서 Indexes 삭제하시고 httpd 재시작하세요.
< Directory "/home/*/public_html">
~
Options Indexes FollowSymLinks <- Options FollowSymLinks
~
< /Directory>
답변에 대한 댓글 1개
팁 감사합니다!!!
<a href="" onclick="MM_openBrWindow('http://kofststp.or.kr/formmail.php','','width=768,height=680')">
요기서 href="" 를 삭제하거나 href="#" 을 함 줘보세요. 경로 문제같은데
답변에 대한 댓글 1개
우와;;;; href=""를 빈칸으로두면 경로가 복잡해지는건가요;;; 여기에 # 을 넣으니까 바로해결됬습니다..!!
乃乃
제 댓글에 다시 코멘틀를 다셔서 저도 삭제가 안됩니다.
원인은 두째치고 해당 글을 재 수정하셔야 할듯..
php 소스 다 보입니다. 보안 어쩌시려고요???
답변을 작성하려면 로그인이 필요합니다.