g

에러좀 찾아주세요

· 2008-04-19 (토) 23:31:17 · 2279 · 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,858
12-08-07 조회 3,523
12-08-03 조회 3,477
12-07-31 조회 3,592
12-07-30 조회 3,551
12-07-16 조회 3,731
12-07-15 조회 3,442
12-07-07 조회 3,419
12-07-06 조회 3,514
12-07-03 조회 3,607
12-06-29 조회 3,202
12-06-22 조회 3,567
12-06-17 조회 3,652
12-05-21 조회 3,729
12-05-02 조회 3,310
12-05-02 조회 4,123
12-05-02 조회 3,236
12-04-30 조회 3,336
12-04-30 조회 3,048
12-03-17 조회 3,865
12-03-10 조회 3,314
12-03-08 조회 3,710
12-03-03 조회 3,494
12-02-27 조회 4,898
12-02-17 조회 4,222
12-02-16 조회 4,377
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,551
11-12-08 조회 3,274
11-12-07 조회 4,306
11-11-27 조회 3,747
11-11-25 조회 3,986
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,191
11-09-01 조회 4,257
11-08-13 조회 2,425
11-08-06 조회 3,114
11-07-11 조회 3,482
11-06-27 조회 2,890
11-06-21 조회 2,495
11-06-13 조회 2,322
11-06-07 조회 2,299
11-05-26 조회 2,310
11-04-20 조회 2,658
11-03-21 조회 2,747
11-03-18 조회 2,424
11-03-11 조회 2,457
11-02-07 조회 2,296
11-01-18 조회 2,626
11-01-12 조회 2,302
11-01-06 조회 2,462
10-12-10 조회 2,720
10-12-09 조회 2,363
10-12-08 조회 4,951
10-11-29 조회 2,454
10-11-28 조회 2,695
10-11-28 조회 2,516
10-11-19 조회 2,704
10-11-04 조회 2,656
10-10-21 조회 2,375
10-10-19 조회 3,320
10-10-12 조회 2,643
10-10-07 조회 2,406
10-09-30 조회 3,428
10-09-17 조회 3,823
10-09-17 조회 3,794
10-05-31 조회 3,441
09-12-31 조회 3,589
09-07-23 조회 4,880
08-09-16 조회 3,156
08-09-06 조회 2,879
08-09-04 조회 3,261
08-08-16 조회 4,347
08-08-15 조회 3,223
08-08-14 조회 4,442
08-08-12 조회 3,802
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,448
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