내가 지금 가지고있는 것은 사진과 일부 홈 비디오가 들어있는 폴더를 들고있는 아파치 서버입니다. 나는 포트를 포워딩하고 내 IP를 입력 할 때 폴더를 보여 주도록했습니다.기본 PHP 비밀번호 보호
<?php
// Define your username and password
$username = "someuser";
$password = "somepassword";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
?>
<h1>Login</h1>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername">Username:</label>
<br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
<p><label for="txtpassword">Password:</label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>
<p><input type="submit" name="Submit" value="Login" /></p>
</form>
<?php
}
else {
?>
<p>This is the protected page. Your private content goes here.</p>
<?php
}
?>
나는 그것이 내 개인의 콘텐츠하지만 난을 넣어라고 선을 발견 내 유일한 문제는 내가 비밀이 파일을 보호 할 수 있도록 사람이 세계이다 곳곳에서 액세스 온라인이 PHP 코드를 발견 할 수 있다는 것입니다 이 작업을 수행하는 방법을 이해하지 못합니다. 메신저 몇 가지 폴더를 보호하기 위해 노력하고 모든 HTML이나 PHP 페이지를 보호하기 위해 노력하지 메신저. 추신 : 파일에 액세스 할 수 내 서버에 ftping이 벌금을 할 수 있지만 나는 또한 모든 브라우저에서 액세스 할 수 싶습니다.
아마 당신은 아파치 서버에 지정된 암호로 더 낫다. '.htaccess file'에 대한 Google 검색을 수행하십시오. – scravy
적절한 CHMODS를 사용하고 .htaccess htaccess deny/allow – Robert