g

에러좀 찾아주세요

· 2008-04-19 (토) 23:31:17 · 2280 · 4
책에 있는 소스를 실행했는데, 에러가 납니다. 어디가 잘못 되었는지요.

===============================
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"];
로 변경해서 한번 해보세요.
2008-04-23 (수) 08:08:23
서버관리자에게 연락하세요
@ 하고 $ 띄우신거 아니죠?
붙여야될듯
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
12-08-29 조회 3,860
12-08-07 조회 3,526
12-08-03 조회 3,477
12-07-31 조회 3,592
12-07-30 조회 3,552
12-07-16 조회 3,732
12-07-15 조회 3,443
12-07-07 조회 3,423
12-07-06 조회 3,516
12-07-03 조회 3,607
12-06-29 조회 3,202
12-06-22 조회 3,567
12-06-17 조회 3,653
12-05-21 조회 3,731
12-05-02 조회 3,314
12-05-02 조회 4,124
12-05-02 조회 3,238
12-04-30 조회 3,338
12-04-30 조회 3,052
12-03-17 조회 3,867
12-03-10 조회 3,314
12-03-08 조회 3,712
12-03-03 조회 3,494
12-02-27 조회 4,898
12-02-17 조회 4,226
12-02-16 조회 4,379
12-02-03 조회 3,244
12-01-31 조회 2,965
12-01-24 조회 3,050
12-01-17 조회 3,803
12-01-05 조회 3,363
11-12-30 조회 2,974
11-12-23 조회 4,553
11-12-08 조회 3,278
11-12-07 조회 4,307
11-11-27 조회 3,748
11-11-25 조회 3,987
11-11-23 조회 3,417
11-11-22 조회 3,381
11-11-09 조회 3,167
11-10-23 조회 3,048
11-10-19 조회 3,031
11-10-08 조회 2,735
11-10-04 조회 2,758
11-10-04 조회 5,192
11-09-01 조회 4,257
11-08-13 조회 2,427
11-08-06 조회 3,114
11-07-11 조회 3,484
11-06-27 조회 2,890
11-06-21 조회 2,495
11-06-13 조회 2,323
11-06-07 조회 2,301
11-05-26 조회 2,312
11-04-20 조회 2,658
11-03-21 조회 2,748
11-03-18 조회 2,426
11-03-11 조회 2,459
11-02-07 조회 2,297
11-01-18 조회 2,626
11-01-12 조회 2,302
11-01-06 조회 2,464
10-12-10 조회 2,720
10-12-09 조회 2,363
10-12-08 조회 4,952
10-11-29 조회 2,454
10-11-28 조회 2,695
10-11-28 조회 2,518
10-11-19 조회 2,708
10-11-04 조회 2,656
10-10-21 조회 2,375
10-10-19 조회 3,320
10-10-12 조회 2,643
10-10-07 조회 2,410
10-09-30 조회 3,431
10-09-17 조회 3,823
10-09-17 조회 3,794
10-05-31 조회 3,444
09-12-31 조회 3,590
09-07-23 조회 4,882
08-09-16 조회 3,156
08-09-06 조회 2,879
08-09-04 조회 3,262
08-08-16 조회 4,348
08-08-15 조회 3,225
08-08-14 조회 4,443
08-08-12 조회 3,803
08-07-23 조회 2,736
08-07-10 조회 3,663
08-07-04 조회 2,896
08-06-27 조회 7,547
08-06-19 조회 4,841
08-05-27 조회 5,450
08-05-25 조회 5,280
08-05-23 조회 3,353
08-05-23 조회 4,453
08-05-21 조회 4,834
08-05-20 조회 3,993
08-05-20 조회 3,237
08-04-18 조회 4,221