I am trying to get the posted information and display the info using the following code:
PHP code:
$self = $_SERVER['PHP_SELF'];
if(isset($_POST['send'])){
$words = htmlspecialchars($_POST['board']);
print "<b>".$words."</b>";
}
HTML code:
<form action="<?php $self ?>" method=post> <!--$self is the directory of the page itself-->
<p><i>Comment</i></p>
<textarea name="board" rows="20" cols="10"></textarea>
<input name="send" type="hidden" />
<p><input type='submit' value='send' /></p>
</form>
The code above will work as I intented. However, if I get rid of the input name="send" type="hidden", the user input message will not show up once the send button is clicked. Why would this happen?
action="<?php $self?>"since you are directing it on the same page.