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,360
17년 전 조회 3,605
17년 전 조회 3,395
17년 전 조회 2,570
17년 전 조회 2,938
17년 전 조회 2,632
17년 전 조회 1,947
17년 전 조회 3,317
17년 전 조회 2,628
17년 전 조회 3,528
17년 전 조회 1,155
17년 전 조회 2,256
17년 전 조회 1,329
17년 전 조회 1,196
17년 전 조회 1,069
17년 전 조회 1,052
17년 전 조회 1,426
17년 전 조회 2,865
17년 전 조회 3,260
17년 전 조회 3,003
17년 전 조회 1,886
17년 전 조회 4,003
17년 전 조회 1,414
17년 전 조회 1,129
17년 전 조회 1,242
17년 전 조회 1,122
17년 전 조회 1,373
17년 전 조회 1,744
17년 전 조회 2,336
17년 전 조회 2,418
17년 전 조회 1,423
17년 전 조회 1,169
17년 전 조회 2,441
17년 전 조회 2,865
17년 전 조회 3,229
17년 전 조회 3,172
17년 전 조회 2,332
17년 전 조회 3,751
17년 전 조회 3,176
17년 전 조회 5,504
17년 전 조회 2,657
17년 전 조회 1,860
17년 전 조회 1,933
17년 전 조회 1,774
17년 전 조회 1,714
17년 전 조회 2,769
17년 전 조회 1,892
17년 전 조회 1,571
17년 전 조회 2,066
17년 전 조회 1,133
17년 전 조회 1,665
17년 전 조회 2,877
17년 전 조회 2,123
17년 전 조회 1,813
17년 전 조회 2,032
17년 전 조회 1,324
17년 전 조회 1,711
17년 전 조회 1,223
17년 전 조회 1,775
17년 전 조회 1,792
17년 전 조회 1,045
17년 전 조회 3,147
17년 전 조회 4,318
17년 전 조회 2,465
17년 전 조회 7,469
17년 전 조회 3,829
17년 전 조회 4,165
17년 전 조회 2,423
17년 전 조회 2,887
17년 전 조회 3,632
17년 전 조회 4,004
17년 전 조회 3,162
17년 전 조회 3,147
17년 전 조회 3,293
17년 전 조회 2,463
17년 전 조회 2,063
17년 전 조회 3,112
17년 전 조회 3,250
17년 전 조회 4,614
17년 전 조회 1,589
17년 전 조회 2,620
17년 전 조회 2,694
17년 전 조회 1,908
17년 전 조회 2,221
17년 전 조회 1,835
17년 전 조회 2,370
17년 전 조회 3,778
17년 전 조회 3,889
17년 전 조회 2,087
17년 전 조회 1,364
17년 전 조회 1,501
17년 전 조회 1,646
17년 전 조회 1,625
17년 전 조회 1,386
17년 전 조회 1,531
17년 전 조회 1,350
17년 전 조회 1,836
17년 전 조회 2,743
17년 전 조회 1,844
17년 전 조회 1,393
🐛 버그신고