Si queremos crear un formulario en PHP donde se carguen los datos en la misma página podemos utilizar lo siguiente:
<?php if(isset($_POST['submit'])) { $name = $_POST['name']; echo "User Has submitted the form and entered this name : <b> $name </b>"; echo "<br>You can use the following form again to enter a new name."; } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="name"><br> <input type="submit" name="submit" value="Submit Form"><br> </form>
Para más información:
http://www.html-form-guide.com/php-form/php-form-action-self.html