I have file index.php with form and I want to process the form with other php file. How can I echo the result to get "Hello name"?
Here's the code:
<form action="action.php" method="post">
Name:<input type="text" name="name">
<button type="submit" name="submit">Submit</button>
</form>
<p>Hello {here goes the name} </p>
And other php file:
<?php
if(isset($_POST['submit'])){
echo $_POST['name'];
}
?>
Hello {here goes the name}
` will not work on the same page. But also [see if there are errors somewhere](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) – mplungjan Apr 20 '21 at 06:31