小编Rai*_*Day的帖子

单击提交按钮后没有任何反应

在我的代码中,我无法弄清楚我错过了什么.我if if声明正在工作,因为我可以看到我的表单,并在提交后我想在标签后看到消息.我怎么知道提交按钮是否响应.

 <?php

$output_form = true;

$fname = "";
$lname = "";
$address1 ="";
$address2 ="";
$city = "";
$state = "";
$zipcode = "";

if (isset($_POST['submit'])) { 

print_r($_POST);

    $fname = trim($_POST["firstName"]);
    $lname = trim($_POST['lastName']);
    $address1 = trim($_POST['address1']);
    $address2 = trim($_POST['address2']);
    $city = trim($_POST['city']);
    $state = trim($_POST['state']);
    $zipcode = trim($_POST['zipcode']);

}

?>
<!DOCTYPE html>
<html>
    <head>
        <title>Assignment 3 </title>
        <link rel="stylesheet" type="text/css" href="style.css">

    </head>
    <body>

        <?php 
        if ($output_form) {
        ?>

        <h1>Enter your information</h1>

        <form name="userform" action="<?= $_SERVER['PHP_SELF'] ?>" method="post">

            <p>First …
Run Code Online (Sandbox Code Playgroud)

php forms

0
推荐指数
1
解决办法
897
查看次数

标签 统计

forms ×1

php ×1