Skip to content Skip to sidebar Skip to footer

Understanding Self Referencing Forms

I am trying to learn Self Referencing Forms. I have read that a html form embedded in a php script is a self referencing form. I am still unable to pick the concept. Almost all the

Solution 1:

You probably mean something like this:

<?phpif (count($_POST)) {
echo'You have submitted the string: '.$_POST['string'];
}
?><formaction=""method="post"><inputtype="text"name="string"><buttontype="submit">Submit!</button></form>

The empty action attribute causes the browser to submit it to the same URL as the one that is loaded. Via count($_POST) we check whether the form was submitted and act accordingly.

Post a Comment for "Understanding Self Referencing Forms"