g

에러좀 찾아주세요

· 2008-04-19 (토) 23:31:17 · 2288 · 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건
+
제목 글쓴이 날짜 조회
08-06-19 조회 2,352
08-06-15 조회 3,089
08-06-15 조회 2,327
08-06-14 조회 2,646
08-06-14 조회 3,543
08-06-14 조회 3,254
08-06-12 조회 2,151
08-06-11 조회 2,180
08-06-11 조회 2,284
08-06-11 조회 7,314
08-06-11 조회 7,043
08-06-08 조회 3,222
08-06-07 조회 2,163
08-06-05 조회 2,284
08-06-05 조회 3,262
08-06-05 조회 2,637
08-06-05 조회 2,296
08-06-05 조회 2,316
08-06-04 조회 2,237
08-06-03 조회 2,220
08-06-03 조회 5,283
08-06-03 조회 3,506
08-06-02 조회 2,813
08-06-02 조회 3,955
08-06-01 조회 2,584
08-05-31 조회 2,283
08-05-31 조회 2,306
08-05-31 조회 2,386
08-05-30 조회 2,268
08-05-29 조회 2,403
08-05-29 조회 3,657
08-05-27 조회 5,477
08-05-26 조회 2,327
08-05-26 조회 5,238
08-05-25 조회 5,308
08-05-24 조회 2,386
08-05-23 조회 3,377
08-05-23 조회 2,782
08-05-23 조회 4,512
08-05-22 조회 2,561
08-05-21 조회 4,894
08-05-21 조회 4,690
08-05-21 조회 3,848
08-05-20 조회 4,443
08-05-20 조회 4,018
08-05-20 조회 3,256
08-05-20 조회 4,518
08-05-20 조회 3,874
08-05-20 조회 4,772
08-05-19 조회 2,312
08-05-16 조회 3,439
08-05-15 조회 2,509
08-05-15 조회 2,346
08-05-15 조회 2,338
08-05-14 조회 2,234
08-05-13 조회 2,689
08-05-13 조회 4,093
08-05-13 조회 4,529
08-05-09 조회 4,305
08-05-08 조회 3,061
08-05-08 조회 5,225
08-05-08 조회 2,598
08-05-07 조회 2,301
08-05-07 조회 2,455
08-05-07 조회 2,259
08-05-01 조회 2,577
08-05-01 조회 2,924
08-04-29 조회 3,752
08-04-28 조회 3,569
08-04-26 조회 2,589
08-04-26 조회 2,328
08-04-26 조회 3,584
08-04-25 조회 4,010
08-04-23 조회 4,441
08-04-22 조회 4,360
08-04-22 조회 3,523
08-04-22 조회 5,060
08-04-22 조회 4,433
08-04-22 조회 6,801
08-04-22 조회 3,893
08-04-21 조회 3,042
08-04-21 조회 3,118
08-04-21 조회 3,064
08-04-21 조회 2,908
08-04-21 조회 4,022
08-04-20 조회 3,178
08-04-20 조회 2,747
08-04-20 조회 3,373
08-04-19 조회 2,289
08-04-18 조회 2,854
08-04-18 조회 4,288
08-04-17 조회 3,531
08-04-17 조회 2,987
08-04-17 조회 3,220
08-04-17 조회 2,498
08-04-17 조회 2,906
08-04-17 조회 2,386
08-04-17 조회 2,947
08-04-17 조회 2,983
08-04-17 조회 2,191