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,357
17년 전 조회 3,601
17년 전 조회 3,394
17년 전 조회 2,566
17년 전 조회 2,938
17년 전 조회 2,628
17년 전 조회 1,947
17년 전 조회 3,315
17년 전 조회 2,627
17년 전 조회 3,526
17년 전 조회 1,153
17년 전 조회 2,254
17년 전 조회 1,324
17년 전 조회 1,193
17년 전 조회 1,067
17년 전 조회 1,051
17년 전 조회 1,424
17년 전 조회 2,861
17년 전 조회 3,258
17년 전 조회 3,000
17년 전 조회 1,883
17년 전 조회 3,998
17년 전 조회 1,411
17년 전 조회 1,124
17년 전 조회 1,239
17년 전 조회 1,119
17년 전 조회 1,371
17년 전 조회 1,739
17년 전 조회 2,334
17년 전 조회 2,416
17년 전 조회 1,421
17년 전 조회 1,167
17년 전 조회 2,438
17년 전 조회 2,862
17년 전 조회 3,228
17년 전 조회 3,168
17년 전 조회 2,329
17년 전 조회 3,751
17년 전 조회 3,172
17년 전 조회 5,501
17년 전 조회 2,655
17년 전 조회 1,859
17년 전 조회 1,933
17년 전 조회 1,771
17년 전 조회 1,709
17년 전 조회 2,766
17년 전 조회 1,889
17년 전 조회 1,571
17년 전 조회 2,066
17년 전 조회 1,131
17년 전 조회 1,664
17년 전 조회 2,874
17년 전 조회 2,119
17년 전 조회 1,812
17년 전 조회 2,029
17년 전 조회 1,321
17년 전 조회 1,711
17년 전 조회 1,220
17년 전 조회 1,771
17년 전 조회 1,792
17년 전 조회 1,041
17년 전 조회 3,142
17년 전 조회 4,317
17년 전 조회 2,463
17년 전 조회 7,466
17년 전 조회 3,828
17년 전 조회 4,160
17년 전 조회 2,422
17년 전 조회 2,887
17년 전 조회 3,629
17년 전 조회 4,001
17년 전 조회 3,159
17년 전 조회 3,146
17년 전 조회 3,291
17년 전 조회 2,463
17년 전 조회 2,060
17년 전 조회 3,109
17년 전 조회 3,250
17년 전 조회 4,613
17년 전 조회 1,587
17년 전 조회 2,617
17년 전 조회 2,691
17년 전 조회 1,904
17년 전 조회 2,220
17년 전 조회 1,834
17년 전 조회 2,369
17년 전 조회 3,777
17년 전 조회 3,886
17년 전 조회 2,085
17년 전 조회 1,359
17년 전 조회 1,500
17년 전 조회 1,641
17년 전 조회 1,623
17년 전 조회 1,384
17년 전 조회 1,528
17년 전 조회 1,349
17년 전 조회 1,832
17년 전 조회 2,742
17년 전 조회 1,840
17년 전 조회 1,388
🐛 버그신고