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,358
17년 전 조회 3,601
17년 전 조회 3,395
17년 전 조회 2,567
17년 전 조회 2,938
17년 전 조회 2,629
17년 전 조회 1,947
17년 전 조회 3,316
17년 전 조회 2,627
17년 전 조회 3,526
17년 전 조회 1,153
17년 전 조회 2,254
17년 전 조회 1,325
17년 전 조회 1,195
17년 전 조회 1,067
17년 전 조회 1,052
17년 전 조회 1,425
17년 전 조회 2,863
17년 전 조회 3,259
17년 전 조회 3,000
17년 전 조회 1,883
17년 전 조회 4,000
17년 전 조회 1,411
17년 전 조회 1,125
17년 전 조회 1,241
17년 전 조회 1,119
17년 전 조회 1,373
17년 전 조회 1,743
17년 전 조회 2,334
17년 전 조회 2,416
17년 전 조회 1,421
17년 전 조회 1,168
17년 전 조회 2,438
17년 전 조회 2,862
17년 전 조회 3,228
17년 전 조회 3,168
17년 전 조회 2,329
17년 전 조회 3,751
17년 전 조회 3,173
17년 전 조회 5,502
17년 전 조회 2,655
17년 전 조회 1,859
17년 전 조회 1,933
17년 전 조회 1,771
17년 전 조회 1,710
17년 전 조회 2,767
17년 전 조회 1,889
17년 전 조회 1,571
17년 전 조회 2,066
17년 전 조회 1,132
17년 전 조회 1,664
17년 전 조회 2,875
17년 전 조회 2,120
17년 전 조회 1,812
17년 전 조회 2,031
17년 전 조회 1,321
17년 전 조회 1,711
17년 전 조회 1,221
17년 전 조회 1,772
17년 전 조회 1,792
17년 전 조회 1,041
17년 전 조회 3,144
17년 전 조회 4,318
17년 전 조회 2,464
17년 전 조회 7,466
17년 전 조회 3,829
17년 전 조회 4,160
17년 전 조회 2,422
17년 전 조회 2,887
17년 전 조회 3,629
17년 전 조회 4,001
17년 전 조회 3,159
17년 전 조회 3,146
17년 전 조회 3,292
17년 전 조회 2,463
17년 전 조회 2,061
17년 전 조회 3,109
17년 전 조회 3,250
17년 전 조회 4,613
17년 전 조회 1,588
17년 전 조회 2,617
17년 전 조회 2,692
17년 전 조회 1,904
17년 전 조회 2,220
17년 전 조회 1,835
17년 전 조회 2,369
17년 전 조회 3,778
17년 전 조회 3,887
17년 전 조회 2,086
17년 전 조회 1,360
17년 전 조회 1,500
17년 전 조회 1,642
17년 전 조회 1,623
17년 전 조회 1,384
17년 전 조회 1,529
17년 전 조회 1,349
17년 전 조회 1,833
17년 전 조회 2,742
17년 전 조회 1,840
17년 전 조회 1,388
🐛 버그신고