g

에러좀 찾아주세요

책에 있는 소스를 실행했는데, 에러가 납니다. 어디가 잘못 되었는지요.

===============================
source : php와 html을 사용해서 간단한 인증 구현
===============================

<?php
// 짧은 스타일의 변수로 만든다.
@ $name = $_POST['name'];
@ $password = $_POST['password'];

if(empty($name)||empty($password))
{
//방문자는 이름과 비밀번호를 써야 한다.
?>
<h1>Please Log In</h1>
This page is secret.
<form method="post" action="secret.php">
<table border="1">
<tr>
<th> Username </th>
<td> <input type="text" name="name"> </td>
</tr>
<tr>
<th> Password </th>
<td> <input type="password" name="password"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Log In">
</td>
</tr>
</table>
</form>
<?php
}
else if($name=='user'&&$password=='pass')
{
// 방문자의 이름, 비밀번호쌍이 맞는 정보였을 때.
echo '<h1>Here it is!</h1>';
echo 'I bet you are glad you can see this secret page.';
}
else
{
// 방문자의 이름, 비밀번호쌍이 틀렸을 때.
echo '<h1>Go Away!</h1>';
echo 'You are not authorized to view this resource.';
}
?>


===================
에러코드
===================

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache Server at localhost Port 80
|

댓글 4개

@ $name = $_POST['name'];
@ $password = $_POST['password'];
부분을
$name = $_POST["name"];
$password = $_POST["password"];
로 변경해서 한번 해보세요.
서버관리자에게 연락하세요
@ 하고 $ 띄우신거 아니죠?
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
17년 전 조회 1,353
17년 전 조회 3,596
17년 전 조회 3,388
17년 전 조회 2,559
17년 전 조회 2,932
17년 전 조회 2,624
17년 전 조회 1,941
17년 전 조회 3,309
17년 전 조회 2,619
17년 전 조회 3,518
17년 전 조회 1,146
17년 전 조회 2,248
17년 전 조회 1,320
17년 전 조회 1,187
17년 전 조회 1,061
17년 전 조회 1,045
17년 전 조회 1,418
17년 전 조회 2,857
17년 전 조회 3,251
17년 전 조회 2,998
17년 전 조회 1,878
17년 전 조회 3,993
17년 전 조회 1,406
17년 전 조회 1,120
17년 전 조회 1,234
17년 전 조회 1,112
17년 전 조회 1,366
17년 전 조회 1,735
17년 전 조회 2,328
17년 전 조회 2,409
17년 전 조회 1,416
17년 전 조회 1,163
17년 전 조회 2,433
17년 전 조회 2,857
17년 전 조회 3,225
17년 전 조회 3,162
17년 전 조회 2,323
17년 전 조회 3,745
17년 전 조회 3,170
17년 전 조회 5,495
17년 전 조회 2,648
17년 전 조회 1,853
17년 전 조회 1,928
17년 전 조회 1,761
17년 전 조회 1,701
17년 전 조회 2,760
17년 전 조회 1,883
17년 전 조회 1,565
17년 전 조회 2,062
17년 전 조회 1,125
17년 전 조회 1,657
17년 전 조회 2,868
17년 전 조회 2,113
17년 전 조회 1,807
17년 전 조회 2,022
17년 전 조회 1,316
17년 전 조회 1,706
17년 전 조회 1,211
17년 전 조회 1,767
17년 전 조회 1,787
17년 전 조회 1,038
17년 전 조회 3,138
17년 전 조회 4,312
17년 전 조회 2,458
17년 전 조회 7,460
17년 전 조회 3,821
17년 전 조회 4,154
17년 전 조회 2,416
17년 전 조회 2,880
17년 전 조회 3,624
17년 전 조회 3,996
17년 전 조회 3,156
17년 전 조회 3,141
17년 전 조회 3,287
17년 전 조회 2,459
17년 전 조회 2,052
17년 전 조회 3,101
17년 전 조회 3,245
17년 전 조회 4,608
17년 전 조회 1,582
17년 전 조회 2,613
17년 전 조회 2,685
17년 전 조회 1,897
17년 전 조회 2,215
17년 전 조회 1,829
17년 전 조회 2,364
17년 전 조회 3,770
17년 전 조회 3,880
17년 전 조회 2,080
17년 전 조회 1,357
17년 전 조회 1,494
17년 전 조회 1,637
17년 전 조회 1,618
17년 전 조회 1,381
17년 전 조회 1,523
17년 전 조회 1,342
17년 전 조회 1,829
17년 전 조회 2,736
17년 전 조회 1,836
17년 전 조회 1,386
🐛 버그신고