在嵌入式网站上使用POST方法

时间:2014-04-11 04:25:56

标签: html post

如果可能,我如何使用POST方法将值发送到嵌入式网页?例如,

<html>
<body>
    <form action="http://example.com" method="post">
        <input name="uname">
        <input name="pword" type="password">
        <input type="submit" value="Login">
    </form>

<!-- I want to send "uname" and "pword" to this object/embedded website below-->

<object data="http://example.com" height="400" width="600">
    <embed src="http://example.com" height="400" width="600">
</object>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

您可以使用iframe并将表单的target属性设置为iframe的name属性。

<html>
<body>
    <form action="http://example.com" method="post" target="target_frame">
        <input name="uname">
        <input name="pword" type="password">
        <input type="submit" value="Login">
    </form>

<!-- I want to send "uname" and "pword" to this object/embedded website below-->

<iframe name="target_frame"></iframe>

</body>
</html>