PHP表单处理

$_REQUEST[]具用$_POST[] $_GET[]的功能,但是$_REQUEST[]比较慢。通过POST和GET方法提交的所有数据都可以通过$_REQUEST数组获得

前端代码(使用php动态生成表单域)

 "First Name",
                "middle_name" => "Middle Name",
                "last_name" => "Last Name",
                "phone" => "Phone");
$submit = "Submit Phone Number";
?>


Customer Phone Number



    

Please enter your phone number below.

$label) { //总是对文本域设置maxlength可以预防恶意攻击 echo "
\n"; } echo "
\n"; echo "\n"; ?>

后端代码


Form Fields
";
echo "
    "; foreach($_POST as $field => $value) { echo "
  1. $field = $value
  2. "; } echo "
"; ?>

你可能感兴趣的:(PHP表单处理)