g

에러좀 찾아주세요

· 2008-04-19 (토) 23:31:17 · 2287 · 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건
+
제목 글쓴이 날짜 조회
11-08-16 조회 2,407
11-08-16 조회 2,381
11-08-12 조회 2,217
11-08-02 조회 2,798
11-07-27 조회 2,186
11-07-25 조회 2,314
11-06-28 조회 2,475
11-06-06 조회 3,983
11-06-04 조회 2,577
11-04-25 조회 6,162
11-04-22 조회 2,663
11-04-21 조회 2,882
11-04-08 조회 3,267
11-03-31 조회 2,807
11-03-20 조회 3,229
11-03-10 조회 2,855
11-03-04 조회 3,179
11-03-03 조회 2,901
11-02-26 조회 4,326
11-02-14 조회 5,681
11-02-08 조회 3,284
11-01-30 조회 5,381
11-01-14 조회 5,165
11-01-14 조회 3,720
11-01-14 조회 2,880
11-01-14 조회 2,917
11-01-14 조회 3,063
11-01-12 조회 2,833
11-01-07 조회 4,498
10-12-29 조회 2,461
10-12-22 조회 2,467
10-12-05 조회 5,860
10-11-22 조회 5,223
10-11-13 조회 3,593
10-10-27 조회 3,207
10-10-21 조회 2,907
10-09-21 조회 2,911
10-09-17 조회 2,950
10-09-15 조회 3,397
10-09-14 조회 4,009
10-05-18 조회 2,878
10-02-17 조회 4,312
10-02-12 조회 3,084
09-12-14 조회 5,149
09-12-14 조회 6,021
09-09-19 조회 4,380
09-08-16 조회 6,226
09-07-22 조회 5,632
09-04-13 조회 3,044
09-03-15 조회 5,049
09-03-05 조회 3,878
09-02-09 조회 2,823
08-12-30 조회 3,017
08-12-06 조회 3,219
08-11-30 조회 3,560
08-10-18 조회 4,396
08-10-08 조회 3,767
08-09-19 조회 4,344
08-09-05 조회 2,981
08-09-05 조회 5,089
08-09-05 조회 2,971
08-09-05 조회 3,563
08-09-05 조회 3,477
08-09-01 조회 4,500
08-08-07 조회 2,749
08-06-08 조회 3,221
08-06-02 조회 2,813
08-05-26 조회 5,236
08-05-09 조회 4,304
08-04-22 조회 3,893
08-04-17 조회 4,483
08-04-17 조회 5,560
08-04-17 조회 3,700
08-04-17 조회 8,679
08-04-17 조회 4,593
08-04-17 조회 4,493
08-04-09 조회 3,050
08-03-31 조회 3,548
08-03-26 조회 3,244
08-03-25 조회 3,535
08-03-25 조회 3,959
08-03-25 조회 4,007
08-03-25 조회 3,666
08-03-25 조회 3,560
08-03-25 조회 3,560
08-03-25 조회 5,250
08-02-03 조회 5,304
08-01-18 조회 6,619
08-01-17 조회 3,918
08-01-17 조회 3,735
08-01-12 조회 4,027
08-01-08 조회 3,351
07-12-28 조회 4,618
07-12-04 조회 3,494
07-11-30 조회 5,102
07-11-30 조회 5,715
07-11-02 조회 4,013
07-10-24 조회 3,988
07-10-24 조회 3,266
07-10-24 조회 3,373