09/10/2018, 23:05

Mình ko truyền được dữ liệu giữa 2 trang php

đây là 2 trang của mình
______login.php_______________
Fill username and password<br>
<form action="check.php">
<input type="text" name="txtUser"> <br>
<input type="password" name="txtPassword">
<br>
<input type="submit" value="Log me in">
</form>
<hr>
______check.php_______________
<?
$user=$HTTP_POST_VARS["txtUser"];
$password=$HTTP_POST_VARS["txtPassword"];
echo "Xin chao ban ".$user."<br>";
echo "Password cua ban la" .$password;
?>
______________________________

mình thiết lập server php 5.1.2,IIS 5.1 thành công rồi,nhưng dữ liệu giữa 2 trang trên ko truyền cho nhau đc ,mặc dù khi load xong trang check.php trên thanh address có hiển thị
/check.php?txtUser=...&txtPassword=...
với "..." là dữ liệu mình nhập vào form ,trước đây mình dùng php 4.x.x thì bình thường ,mình mới làm quen với php ,có ai giúp mình được không
kid08 viết 01:14 ngày 10/10/2018
bạn chưa set cho form phương thức truyền dữ liệu thì sao mà nhận trời
Bim viết 01:19 ngày 10/10/2018
Chỉnh:

<form action="check.php">

Thành:

<form method="POST" action="check.php">
napoleonman viết 01:18 ngày 10/10/2018
thank nhìu......quên
ohyesssvn viết 01:22 ngày 10/10/2018
The deprecation of the old $HTTP_*_VARS arrays (which need to be indicated as global when used inside a function or method). The following autoglobal arrays were introduced in PHP 4.1.0. They are: $_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, $_REQUEST, and $_SESSION. The older $HTTP_*_VARS arrays, such as $HTTP_POST_VARS, still exist as they have since PHP 3. As of PHP 5.0.0, the long PHP predefined variable arrays may be disabled with the register_long_arrays directive.
Bài liên quan
0