PHP:读取输入字段的值

Kla*_*sos 0 php post

我有一个关于PHP的基本问题.所以,有index.php一个表格.此表单包含输入字段field1:

的index.php

    <div id="container1">
    <form name="optform" method="post" action="processing.php">
                <div class = "box">
                    <label for="field1"><span>Bla bla bla:</span></label>
                    <input type="text" class="input-text" value="5" size="11" maxlength="11" name="field1" id="field1">
                </div>
                <br/>
            <div class="buttons">
                <a href="" class="regular" onclick="click_function();return false;">Run</a>
            </div>
    </form>
    </div>

    <div id="container2">

    </div>

    <script language="javascript">
    function click_function() {
         $('#container2').load('processing.php');
    }
    </script>
Run Code Online (Sandbox Code Playgroud)

我需要使用field1另一个名为as的PHP文件中的值processing.php.那么,我怎样才能从中读取这个值processing.php?我应该这样做processing.php吗?

processing.php

$field1value = $_POST["field1"];
Run Code Online (Sandbox Code Playgroud)

Que*_*tin 6

action属性指定浏览器将提交的URL.那是目前的index.php.

如果要使用代码processing.php来处理表单数据,那么索引必须包括处理,而不是相反.(因为代码代表,processing.php根本不会涉及,因此不能包含任何内容).

或者,将操作更改为指向processing.php.