功能应用程序的错误

时间:2018-04-12 23:47:14

标签: php html

我已经创建了一个联系表单,我可以在我的网站上运行,但是,我也在我的网站上创建了另一个页面的第二个表单,它起到了申请表的作用。

我所做的是将功能性联系表单复制并粘贴到此应用程序表单上,然后在HTML和PHP上添加更多字段。

但是,表单不会将信息提交给电子邮件,因为联系表单的确如此,它们都是完全相同的...只有差异就是更​​多字段。

我已经看过原因可能是什么但是我似乎无法发现它...如果我在同一个网站上有两个表格但不同的页面,我应该添加一个特定的功能吗?

我已经查看了我在Google上遇到的代码错误检查程序,似乎说HTML上的输入行有问题。我为我的联系表格做了同样的事情,但似乎没问题。我不明白为什么如果它们是相同的话可能会说。

在HTML name="example_1"字段中,我添加了下划线,但在PHP上使用了相同的内容。这是PHP中甚至允许的东西吗?

我还想提一下,表单没有主题或消息字段,因为不需要。每个PHP文件都需要表单吗?

请原谅我的业余问题,但这对我来说都很新鲜,我似乎无法找到我的混乱的根源。我希望我们能够共同解决错误的根源。

我添加了编码,以便更容易理解我所说的内容。



<?php
session_start();
if( isset($_POST['name']) && strtoupper($_POST['captcha']) == $_SESSION['captcha_id'] )
{
	$to = 'mytestgmail@gmail.com'; // Replace with your email	
	$subject = 'You have a new application!'; // Replace with your $subject
	$headers = 'From: ' . 'mygmail@gmail.com' . "\r\n" . 'Reply-To: ' . $_POST['email_address'];	
	
	$message = 'Full Name: ' . $_POST['full_name'] . "\n" .
			   'Date of Birth: ' . $_POST['dob'] . "\n" .
			   'E-mail: ' . $_POST['email_address'] . "\n" .
			   'Contact: ' . $_POST['contact_number'] . "\n" .
			   'Address: ' . $_POST['home_address'] . "\n" .
			   'Make: ' . $_POST['make'] . "\n" .
			   'Model: ' . $_POST['model'] . "\n" .
			   'Registration: ' . $_POST['reg'] . "\n" .
			   'ID: ' . $_POST['id'] . "\n" . "\n" .

			   'TP Full Name: ' . $_POST['tp_full_name'] . "\n" .
			   'TP Date of Birth: ' . $_POST['tp_dob'] . "\n" .
			   'TP E-mail: ' . $_POST['tp_email_address'] . "\n" .
			   'TP Contact No.: ' . $_POST['tp_contact_number'] . "\n" .
			   'TP Address: ' . $_POST['tp_home_address'] . "\n" .
			   'TP Make: ' . $_POST['tp_make'] . "\n" .
			   'TP Model: ' . $_POST['tp_model'] . "\n" .
			   'TP Registration: ' . $_POST['tp_reg'] . "\n" .
			   'TP ID: ' . $_POST['tp_id'] . "\n" . "\n" .
	           'Source: ' . $_POST['source'];
	
	mail($to, $subject, $message, $headers);	
	if( $_POST['copy'] == 'on' )
	{
		mail($_POST['email_address'], $subject, $message, $headers);
	}
}
?>
&#13;
          <form action="claims-process.php" method="post" id="sky-form" class="sky-form sty-one" novalidate>
            <fieldset class="sty-one">
              <br>
              <br>
              <h5 class="uppercase">Your Details</h5>
              <br>
              <div class="row">
                <section class="col col-6">
                  <label class="label">Full Name</label>
                  <label class="input">
                    <i class="icon-append fa fa-user"></i>
                    <input name="name" id="name" type="text">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">Date of Birth</label>
                  <label class="input">
                    <i class="icon-append fa fa-calendar"></i>
                    <input name="dob" id="name" type="text">
                  </label>
                </section>
              </div>
              
              <div class="row">
                <section class="col col-6">
                  <label class="label">E-mail</label>
                  <label class="input">
                    <i class="icon-append fa fa-envelope-o"></i>
                    <input name="email_address" id="name" type="email">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">Contact Number</label>
                  <label class="input">
                    <i class="icon-append fa fa-phone"></i>
                    <input name="contact_number" id="name" type="number" minlength="11" maxlength="13">
                  </label>
                </section>
              </div>
              <section>
                <label class="label">Address</label>
                <label class="textarea">
                  <i class="icon-append fa fa-home"></i>
                  <textarea rows="4" name="home_address" id="name"></textarea>
                </label>
              </section>

              <div class="row">
                <section class="col col-6">
                  <label class="label">Make</label>
                  <label class="input">
                    <i class="icon-append fa fa-car"></i>
                    <input name="make" id="name" type="text">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">Model</label>
                  <label class="input">
                    <i class="icon-append fa fa-car"></i>
                    <input name="model" id="name" type="text">
                  </label>
                </section>
              </div>
              <div class="row">
                <section class="col col-6">
                  <label class="label">Registration</label>
                  <label class="input">
                    <i class="icon-append fa fa-car"></i>
                    <input name="reg" id="name" type="text">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">ID</label>
                  <label class="input">
                    <i class="icon-append fa fa-shield"></i>
                    <input name="id" id="name" type="text" minlength="11" maxlength="13">
                  </label>
                </section>
              </div>   
              <br>
              <br>
              <h5 class="uppercase">TP</h5>
              <br>
              <div class="row">
                <section class="col col-6">
                  <label class="label">TP Full Name</label>
                  <label class="input">
                    <i class="icon-append fa fa-user"></i>
                    <input name="tp_full_name" id="name" type="text">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">TP Date of Birth</label>
                  <label class="input">
                    <i class="icon-append fa fa-calendar"></i>
                    <input name="tp_dob" id="name" type="text">
                  </label>
                </section>
              </div>
              
              <div class="row">
                <section class="col col-6">
                  <label class="label">TP E-mail</label>
                  <label class="input">
                    <i class="icon-append fa fa-envelope-o"></i>
                    <input name="tp_email_address" id="name" type="text">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">TP Contact Number</label>
                  <label class="input">
                    <i class="icon-append fa fa-phone"></i>
                    <input name="tp_contact_number" id="name" type="number" minlength="11" maxlength="13">
                  </label>
                </section>
              </div>

              <section>
                <label class="label">TP Address</label>
                <label class="textarea">
                  <i class="icon-append fa fa-home"></i>
                  <textarea rows="4" name="tp_home_address" id="name"></textarea>
                </label>
              </section>

              <div class="row">
                <section class="col col-6">
                  <label class="label">TP Make</label>
                  <label class="input">
                    <i class="icon-append fa fa-car"></i>
                    <input name="tp_make" id="name" type="text">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">TP Model</label>
                  <label class="input">
                    <i class="icon-append fa fa-car"></i>
                    <input name="tp_model" id="name" type="text">
                  </label>
                </section>
              </div>
              <div class="row">
                <section class="col col-6">
                  <label class="label">TP Registration</label>
                  <label class="input">
                    <i class="icon-append fa fa-car"></i>
                    <input name="tp_reg" id="name" type="text">
                  </label>
                </section>
                <section class="col col-6">
                  <label class="label">TP ID</label>
                  <label class="input">
                    <i class="icon-append fa fa-shield"></i>
                    <input name="tp_id" id="name" type="text">
                  </label>
                </section>
              </div>              
              <section>
                <label class="label">Source</label>
                <label class="input">
                  <i class="icon-append fa fa-tag"></i>
                  <input name="source" id="subject" id="name" type="text">
                </label>
              </section>

              <section>
                <label class="label">Enter characters below:</label>
                <label class="input input-captcha">
                  <img src="captcha/image.php?<?php echo time(); ?>" alt="Captcha image" width="100" height="35">
                  <input maxlength="6" name="captcha" id="captcha" type="text">
                </label>
              </section>
              
              <section>
                <label class="checkbox"><input name="copy" type="checkbox"><i></i>Send a copy to my e-mail address</label>
              </section>
            </fieldset>
            <footer>
              <button type="submit" name="submit" class="button">Submit Claim</button>
            </footer>
				  <div class="message">
					  <i class="fa fa-check"></i>
					  <p>Your message was successfully sent!</p>
				  </div>
			  </form>
&#13;
&#13;
&#13;

0 个答案:

没有答案