It is a very simple form as in the code below:
<form method="POST" action="news.php?nid=2">
<textarea id="txtcomment" style="width:100%; height: 70px;" maxlength="300"></textarea><br /><br />
<input type="submit" class="button" style="float: right; cursor:pointer;" value="Comment">
</form>
but in the news.php i cannot get the value of "txtcomment"
echo $_POST['txtcomment'];
it returns nothing...
It is because you need to name the textarea:
<textarea name="txtcomment"></textarea>
The id
parameter does not have anything to do with how forms work (with the exception of label
s, but that is not important here).
Specify the name attribute of the textarea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With