링크 관련 조언 부탁드립니다. 채택완료
그누보드5 사용하고 있습니다.
g5/theme/basic/mobile/index.php 가 모바일 페이지 첫 화면인데,
index.php에서 같은 폴더 안에 있는 aaa.php 로 이동하는 링크를 만들려고 한다면
아래와 같이 링크를 만들면 정상적으로 작동합니다.
</p>
<p><a href="<?php echo G5_THEME_URL; ?>/mobile/aaa.php">aaa 링크</a></p>
<p>
그런데
g5/theme/basic/mobile/box/bbb.php를 넣어 놓고,
index.php에서 bbb.php로 이동하려고 아래와 같이 링크를 만들면 오류가 납니다.
</p>
<p><a href="<?php echo G5_THEME_URL; ?>/mobile/box/bbb.php">bbb 링크</a></p>
<p>
이렇게 저렇게 바꾸어 보아도 이상하게 위에 것은 정상적으로 작동하고 아래 것은 오류가 나네요...
어떤 부분에서 문제가 있는 것인지 조언 부탁드립니다.
답변 3개
warring: include_once(_common.php):
failed to open stream: No Such File or directory in
www/g5/theme/basic/mobile/box/bbb.php
on line 2 Warning: include_once(): Failed
opening '_common.php' for inclusion
(include_path='.:/usr/share/pear:/usr/share/php')
in
www/g5/theme/basic/mobile/box/bbb.php on line 2
include_once(_common.php); 이게 잘못됐어요
include_once('../../_common.php'): 이렇게해서 경로는 ../ 맞춰보세요 그대로 에러 나오면 ../ 추가해서 경로를 맞춰요
답변에 대한 댓글 4개
만약에 그러고 에러 나오면 include_once('../../../../../common.php'): 이렇게 루트 위치까지 올라가면되요 그러니까 즉 현재 파일 경로에서 루트 g5 내에서 위치랑 수에 맞게 연결하면되요
원래 바로 전 폴더에 있는 _common.php를 불러오는 것이니까 ../를 한 번만 넣으면 되는 게 아닌가요?
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 2개
failed to open stream: No Such File or directory in
www/g5/theme/basic/mobile/box/bbb.php
on line 2 Warning: include_once(): Failed
opening '_common.php' for inclusion
(include_path='.:/usr/share/pear:/usr/share/php')
in
www/g5/theme/basic/mobile/box/bbb.php on line 2
이렇게 오류가 출력됩니다.
bbb.php 2번째 줄은 아래와 같습니다.
[code]
include_once("_common.php"); // 개별 페이지 접근을 위해 추가
[/code]
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 1개
failed to open stream: No Such File or directory in
www/g5/theme/basic/mobile/box/bbb.php
on line 2 Warning: include_once(): Failed
opening '_common.php' for inclusion
(include_path='.:/usr/share/pear:/usr/share/php')
in
www/g5/theme/basic/mobile/box/bbb.php on line 2
이렇게 출력됩니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인