Question : php post form to self
Answered by : geeky-bravo
// Here is how to post form data to self or to the same page &
// avoid the PHP_SELF exploits at the same time.
<form name="my_form" method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
</form>
Source : | Last Update : Tue, 30 Jun 20
Question : form post self php
Answered by : tamer-essam
<?php if (!empty($_POST)): ?> Welcome, <?php echo htmlspecialchars($_POST["name"]); ?>!<br> Your email is <?php echo htmlspecialchars($_POST["email"]); ?>.<br>
<?php else: ?> <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post"> Name: <input type="text" name="name"><br> Email: <input type="text" name="email"><br> <input type="submit"> </form>
<?php endif; ?>
Source : https://stackoverflow.com/questions/5826784/how-do-i-make-a-php-form-that-submits-to-self | Last Update : Mon, 15 Feb 21