如何将PHP表单POST值发送到CGI URL?

时间:2017-03-26 15:22:56

标签: php forms post request cgi

我想将php值发送到cgi url

 <form method="post" action="https://192.168.10.1:10443/cgi-bin/outgoingfw.cgi/cgi-bin/outgoingfw.cgi" style="float:left">
                    <input name="ACTION" value="disable" type="hidden">
                    <input name="line" value="0" type="hidden">
                </form>

我希望将这些值与PHP POST请求一起发送到url

  

https://192.168.10.1:10443/cgi-bin/outgoingfw.cgi

任何人都可以帮我解决这个问题。

4 个答案:

答案 0 :(得分:0)

您缺少提交按钮

  <form action="https://192.168.10.1:10443/cgi-bin/outgoingfw.cgi/cgi-bin/outgoingfw.cgi" method="POST">
       <input type="submit" value="Publish">
       <input name="ACTION" value="disable" type="hidden">
       <input name="line" value="0" type="hidden">
 </form>

供进一步参考:http://www.comp.leeds.ac.uk/Perl/Cgi/textareas.html

答案 1 :(得分:0)

只需添加“提交”按钮即可。

     <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form method="post" action="https://192.168.10.1:10443/cgi-bin/outgoingfw.cgi" style="float:left">
    <input name="ACTION" value="disable" type="hidden">
    <input name="line" value="0" type="hidden">

    <!-- submit button -->
    <input type="submit" value="submit"/>

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

答案 2 :(得分:0)

如果您想自动发送。没有按下按钮。否则,你为什么需要隐藏的字段?

  <form method="post" action="https://192.168.10.1:10443/cgi-bin/outgoingfw.cgi/cgi-bin/outgoingfw.cgi" style="float:left">
        <input name="ACTION" value="disable" type="hidden">
        <input name="line" value="0" type="hidden">
    </form>
    <script>
        document.getElementsByTagName('form')[0].submit();
    </script>

答案 3 :(得分:-1)