I really thought I had this one down, but for some reason inside the echo it doesn't want to perform the command. It just echo's it to the web page url.
http://localhost/<?php echo htmlentities($_SERVER[\'PHP_SELF\']); ?>
<?php
echo' <form name="action" action="<?php echo htmlentities($_SERVER[\'PHP_SELF\']); ?>" method="post">
<input type="text" name="name"><br>
<input type="submit" name="submit" value="Submit Form"><br>
</form>';
?>
I was going to try and have it post to self and then if there is post data then:
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['action'])){
//do something here
}
I tried to break the echo also:
echo " <form name='action' action=".<?php echo htmlentities($_SERVER['PHP_SELF']); ?>." method="post">
<input type='text' name='name'><br>
<input type='submit' name='submit' value='Submit Form'><br>
</form>";