Cha*_*kar 2 html php forms submit
虽然从PHP回显一个表单并从php中的文件中检索到一些预定义的值,但我遇到了麻烦.
我可以在预期的两个输入框中看到这些预定义值,即文章的内容和标题.
但每当我点击提交时,表单的内容部分都没有提交.
当我做print_r($ _ REQUEST); 我只看到以下o/p数组([action] => edit_art [art_id] => 11 $ art_id [title] => TCS [agree] => on)
当我没有为内容输入框(textarea)提供预定义值时,它将被提交,无论我输入什么内容.
我的代码如下
echo '<form action="art_action.php?action=edit_art&art_id=$art_id" method="post"><br />
<p><b>Article Title</b></p>
<input type="text" name="title" **value='.$art_title.'**/><br />
<span id="title_check"></span><br />
<p><b>Content</b></p><br />
<textarea cols="75" rows="20" **value='.$content.'** name="content"></textarea><br />
<span id="content_check"></span>
<div class="content" ><input type="checkbox" name="agree" style="margin-right:10px"/>Agree Terms and Conditions first.<span id="agree_check"></span><br />
<input type="button" onclick="varify_and_post_article(this.form)" Value="Post Article"/><br />
</form>';
Run Code Online (Sandbox Code Playgroud)
请帮帮我.Thanx提前!!
textarea没有value属性,你应该把$content标签放在里面
echo '<textarea cols="75" rows="20" name="content">'.$content.'</textarea>'
Run Code Online (Sandbox Code Playgroud)