在php中使用来自html textarea的帖子数据

时间:2015-03-10 00:31:29

标签: php html textarea

我只是想使用php脚本从html textarea表单中获取我的POST数据,但我似乎无法弄清楚为什么它实际上没有发布数据。我很确定所有语法都是正确的。

html:support.html

<form action = 'submit.php' method = 'post'>
First Name <input type = 'text'  name = 'firstname'><br><br>
Last Name <input type = 'text'  name = 'lastname'><br><br>
Email Address <input type = 'text'  name = 'email'><br><br>
Subject <input type = 'text'  name = 'subject'><br><br>
Details<br>
<textarea  name = 'details'  rows = '10' cols = '75'></textarea></br>
<input type = 'submit' name = 'Submit' value = 'Submit' >
</form>

php:submit.php

<?php
 /*

 Process user information

 */
 include 'init.php'; // connecting to mysql database 
 $success = false; // flag for whether all forms are filled out
 if (isset($_POST['details']))    
 {
 $details = $_POST['details'];
 echo "$details"; // checking to see what is in textarea
 }
 // more processing & mysql database work
  ?>

所有其他表单数据都正确发送。我没有展示mysql数据库工作,但它不应该干扰如何获得后期数据?

0 个答案:

没有答案