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,355
17년 전 조회 3,596
17년 전 조회 3,389
17년 전 조회 2,560
17년 전 조회 2,935
17년 전 조회 2,624
17년 전 조회 1,941
17년 전 조회 3,310
17년 전 조회 2,620
17년 전 조회 3,520
17년 전 조회 1,147
17년 전 조회 2,249
17년 전 조회 1,321
17년 전 조회 1,188
17년 전 조회 1,062
17년 전 조회 1,047
17년 전 조회 1,419
17년 전 조회 2,858
17년 전 조회 3,252
17년 전 조회 2,998
17년 전 조회 1,880
17년 전 조회 3,994
17년 전 조회 1,406
17년 전 조회 1,120
17년 전 조회 1,234
17년 전 조회 1,113
17년 전 조회 1,366
17년 전 조회 1,736
17년 전 조회 2,330
17년 전 조회 2,410
17년 전 조회 1,417
17년 전 조회 1,164
17년 전 조회 2,434
17년 전 조회 2,858
17년 전 조회 3,225
17년 전 조회 3,164
17년 전 조회 2,325
17년 전 조회 3,747
17년 전 조회 3,171
17년 전 조회 5,496
17년 전 조회 2,651
17년 전 조회 1,854
17년 전 조회 1,930
17년 전 조회 1,764
17년 전 조회 1,704
17년 전 조회 2,762
17년 전 조회 1,885
17년 전 조회 1,568
17년 전 조회 2,063
17년 전 조회 1,127
17년 전 조회 1,659
17년 전 조회 2,870
17년 전 조회 2,116
17년 전 조회 1,809
17년 전 조회 2,024
17년 전 조회 1,318
17년 전 조회 1,707
17년 전 조회 1,213
17년 전 조회 1,769
17년 전 조회 1,789
17년 전 조회 1,039
17년 전 조회 3,139
17년 전 조회 4,313
17년 전 조회 2,459
17년 전 조회 7,461
17년 전 조회 3,822
17년 전 조회 4,156
17년 전 조회 2,418
17년 전 조회 2,881
17년 전 조회 3,626
17년 전 조회 3,997
17년 전 조회 3,157
17년 전 조회 3,143
17년 전 조회 3,288
17년 전 조회 2,461
17년 전 조회 2,054
17년 전 조회 3,102
17년 전 조회 3,246
17년 전 조회 4,609
17년 전 조회 1,582
17년 전 조회 2,614
17년 전 조회 2,687
17년 전 조회 1,899
17년 전 조회 2,217
17년 전 조회 1,831
17년 전 조회 2,366
17년 전 조회 3,772
17년 전 조회 3,882
17년 전 조회 2,081
17년 전 조회 1,357
17년 전 조회 1,495
17년 전 조회 1,638
17년 전 조회 1,618
17년 전 조회 1,381
17년 전 조회 1,524
17년 전 조회 1,343
17년 전 조회 1,831
17년 전 조회 2,739
17년 전 조회 1,837
17년 전 조회 1,387
🐛 버그신고