아 이걸 분명 예전에 알았었는데
까먹는 바람에
다시는 까먹지 않는다는 다짐으로
남김
submit_test.php
<html>
<head>
<title>
PHP mysql query test
</title>
<script>
function send() {
document.unnameid.submit();
}
</script>
</head>
<body>
<form name="unnamed" id="unnameid" action="show.php" method="post">
Name : <input typt="text" size ="10" maxlength="40" name="name"> <br/>
Phone : <input type="text" size="10" maxlength="40" name="phone"> <br/>
<input type="button" value="submit" onclick="send();">
</form></body>
</html>
show.php
<?
$name = $_POST["name"];
$phone = $_POST["phone"];echo "This is test<br/>";
echo "$name<br/>";
echo "$phone<br/>";
?>
위와 같이 코딩을 하게되면 submit_test.php 에 존재하는 form 안의 값이
post 명령을 통해서
show.php에 전달되게 됩니다
이 전달된 값은 $_POST["변수명"] 에 저장되는데
이것을 이용해서 php code를 작성하면
작전 완료