PHP 코드
send.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<!
DOCTYPE
html>
<html lang
=
"kr"
>
<head>
<meta charset
=
"utf-8"
>
<title>
키보드와 하루
</title>
</head>
<body>
<?php
$t1
= 1000;
$t2
= 2000;
?>
<form method
=
"POST"
action
=
"call.php"
>
//php에 있는 t1과 t2 값을 숨김으로 call.php로 보냄
<input type
=
"hidden"
name
=
"t1"
value
="<?php
echo
$t1
;?>"
/>
<input type
=
"hidden"
name
=
"t2"
value
="<?php
echo
$t2
;?>"
/>
<input type
=
"submit"
value
=
"전송"
/>
</form>
</body>
</html>
|
call.php
1
2
3
4
5
6
7
8
9
10
|
<?php
//send.php에 보낸 t1과 t2 값을 받음
$v_testVal1
=
$_POST
[
"t1"
];
$v_testVal2
=
$_POST
[
"t2"
];
print_r
(
$v_testVal1
);
print_r
(
"<br><br>"
);
print_r
(
$v_testVal2
);
?>
|