[질문] 값이 안 넘어 갑니다.

zaru의 이미지

RH 7.3 리눅스에 APM을 소스설치하고 아파치 config도 정확하게(?) 설정 되었습니다.

IP 치면 아파치의 index.html이 잘 보이구요, phpinfo() 도 잘 보입니다.

다음과 같이 폼테스트를 하였습니다.

formtest.php

<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>아이디</title>
<meta name="generator" content="Namo WebEditor v5.0">
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p align="center">&</p>

<form name="form1" method="post" action="formaction.php">
<table align="center" border="1" width="296">
    <tr>
        <td width="116">
            <p align="center">아이디</p>
        </td>
        <td width="164">
                <p><input type="text" name="id"></p>
        </td>
    </tr>
    <tr>
        <td width="116">
            <p align="center">비밀번호</p>
        </td>
        <td width="164">
                <p><input type="text" name="passwd"></p>
        </td>
    </tr>       
</table>
    <p align="center"><input type="submit" value="확인"> <input type="reset" value="취소"></p>
</form> 
<p align="center">&</p>
</body> 
        
</html>         

formaction.php

<?
print "id = $id <br>";
print "pass = $passwd <br>";

echo "id = ", $id, "<br>";
echo "pass = ", $passwd, "<br>";
?>

라고 해서 브라우저(WinXP 환경의 IE)에서 실행을 하면

id =
pass =

이렇게 아무것도 나타나질 않습니다.

이런 경우가 어떤 경우인지요. 그리고 무엇이 문제인지요.

감사합니다.

nainu의 이미지

register_globals 값이 off로 되어있어 그렇습니다.
$_POST['id'], $_POST['pass'] 로 접근하시면 잘 보일 것입니다.

보안상 좋지 않지만 register_globals 를 켜 주려면 .htaccess 에서
켜 주는 방법과 /etc/php/php.ini에서 켜 주는 방법이 있습니다..

이에 대한 글은 많으니 검색을 해 보세요.