PHP数组后期方法

时间:2016-01-23 16:22:34

标签: php arrays post

当我尝试POST一个有一些问题的数组时,

这是我的代码

提前致谢

for(;$i>0;$i=$i-1){
    $j=$new+1;
    echo '</br>'.$j.'. <form action="3.php" method="post"/><input type="textarea" name="o[.$new]"/><input type="text" name="o2[.$new]"/><input type="text" name="o3[.$new]"/><input type="submit" value="Send"/></form></br>';
    $new=$new+1;
}

我想要实现的是创建动态数量的textarea,并等待用户填写这些区域,然后将这些数据发布到“3.php”页面。

<form action="3.php" method="post"/>
    <input type="textarea" name="o[.$new]"/>
    <input type="text" name="o2[.$new]"/>
    <input type="text" name="o3[.$new]"/>
    <input type="submit" value="Send"/>
</form>

1 个答案:

答案 0 :(得分:1)

发布textareas号码的第一个表格:

using System;
namespace acc
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void btnOne_Click(object sender, EventArgs e)
            {
                Int32 a = Convert.ToInt32(mlktotal.Text);
                Int32 b = Convert.ToInt32(yogtotal.Text);
                Int32 c = a + b;
                totalamount.Text = c.ToString();

            }

            private void mlkbuykg_TextChanged(object sender, EventArgs e)
            {

                Int32 a = Convert.ToInt32(mlkrate.Text);
                Int32 b = Convert.ToInt32(mlkbuykg.Text);
                Int32 c = a * b;
                mlktotal.Text = c.ToString();

            }

            private void mlktotal_TextChanged(object sender, EventArgs e)
            {

            }

            private void buyyug_TextChanged(object sender, EventArgs e)
            {
                Int32 a = Convert.ToInt32(buyyog.Text);
                Int32 b = Convert.ToInt32(yogurtrate.Text);
                Int32 c = a * b;
                yogtotal.Text = c.ToString();

            }
        }
    }


posting.php是:

<form action="posting.php" method="post">
    <input type="text" name="textareasNum">
    <input type="submit" value="Send the number of textareas">
</form>