提问者:小点点

如何将数据从一个html页面发送到其他网站php页面?


嗨,任何人,请帮助我发送数据从一个html页面到其他网站php页面。

我在用这个,但不起作用。

第1.html页:

<html>
<head>
<body>
<form method="post" action="https://www.check.com/check2.php">

    <input type="text" name="name">
    <button name="btn"></button>

</form>
</body>
</head>
</html>

Page 2.php(其他网站代码-(https://www.check.com/check2.php)):

<?php

    if (isset($_POST['btn'])) {
       $name= $_POST['name'];
       echo $name;
    }
    else
    {
    echo "failed";
    }

?>

输出:

失败

请帮助排序此问题!


共1个答案

匿名用户

尝试:

    <html>
<head>
<body>
<form method="post" action="https://www.check.com/check2.php">

    <input type="text" name="name">
    <button type="sumbit" name="btn"></button> 

</form>
</body>
</head>
</html>

相关问题