g

에러좀 찾아주세요

· 2008-04-19 (토) 23:31:17 · 2296 · 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건
+
제목 글쓴이 날짜 조회
10-05-31 조회 2,919
10-04-17 조회 4,700
10-03-23 조회 5,861
10-02-26 조회 3,377
10-02-23 조회 3,339
10-02-11 조회 3,959
10-02-09 조회 3,018
10-01-26 조회 3,473
10-01-23 조회 6,807
10-01-19 조회 3,511
10-01-13 조회 3,717
09-12-06 조회 4,655
09-11-24 조회 4,198
09-11-19 조회 3,076
09-11-11 조회 3,674
09-08-30 조회 3,159
09-08-12 조회 3,150
09-07-21 조회 3,331
09-07-19 조회 3,215
09-07-11 조회 3,133
09-06-15 조회 2,911
09-05-29 조회 3,081
09-05-28 조회 3,516
09-05-05 조회 3,372
09-04-07 조회 3,583
09-02-23 조회 4,382
09-02-17 조회 3,130
09-02-17 조회 2,506
09-02-09 조회 2,613
09-01-23 조회 3,421
09-01-17 조회 4,246
09-01-08 조회 3,192
08-11-07 조회 4,446
08-11-01 조회 4,934
08-10-30 조회 3,530
08-10-16 조회 3,451
08-10-02 조회 2,589
08-09-22 조회 3,940
08-09-22 조회 2,905
08-09-20 조회 5,401
08-09-20 조회 4,459
08-09-20 조회 3,534
08-09-20 조회 2,913
08-09-20 조회 3,116
08-09-20 조회 4,098
08-09-20 조회 3,589
08-09-20 조회 3,173
08-09-18 조회 3,422
08-09-06 조회 3,021
08-09-06 조회 2,764
08-09-05 조회 3,423
08-09-05 조회 5,634
08-09-03 조회 4,438
08-09-03 조회 2,689
08-07-31 조회 3,167
08-07-18 조회 3,767
08-06-19 조회 3,109
08-06-15 조회 3,106
08-06-14 조회 3,562
08-05-23 조회 2,799
08-05-13 조회 2,701
08-04-22 조회 4,387
08-04-22 조회 5,084
08-04-22 조회 6,820
08-04-17 조회 2,998
08-04-17 조회 3,587
08-04-17 조회 3,680
08-04-17 조회 5,922
08-04-17 조회 3,120
08-04-17 조회 3,451
08-04-06 조회 3,533
08-04-05 조회 3,113
08-04-04 조회 7,173
08-04-04 조회 4,460
08-04-04 조회 3,812
08-04-04 조회 3,994
08-04-04 조회 2,875
08-04-04 조회 2,655
08-04-04 조회 2,702
08-04-04 조회 2,895
08-04-04 조회 2,650
08-04-04 조회 2,623
08-04-04 조회 4,136
08-04-03 조회 2,655
08-04-03 조회 3,869
08-04-02 조회 3,091
08-04-02 조회 2,832
08-03-25 조회 3,688
08-03-11 조회 3,449
08-03-11 조회 2,957
08-03-11 조회 2,915
08-03-11 조회 2,714
08-03-11 조회 2,488
08-03-11 조회 2,293
08-03-11 조회 2,353
08-03-07 조회 2,893
08-03-05 조회 2,636
08-02-27 조회 2,871
08-02-21 조회 2,747
08-02-21 조회 3,320