got a small problem, this code
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<?php
...
echo '<input name="textfield" type="text" id="textfield" value="Roger" />';
echo 'Hello, '.$_POST['textfield'].'<br>';
...
?></p>
</form>
should echo out “Hello, Roger”, as roger is the default value, yet it gives out only “Hello, ” and nothing else. Any suggestions?
edit: yes, there’s a form.
Thanks!
You are echoing the text box and at the same time hoping to gets its value, which is not possible.
You need to first submit the form with method set to
postand only then you can get its value.Example:
PHP