Answers for "how redirect form on same page on submit in php"

PHP
1

form action on same page in php

<form action="<php echo $_SERVER['php_shelf'] ?>" method="POST">
  <--
  Your inputs here
  --!>
  
  
 </form>
  
 <?php
  if(isset($_POST['your input name']){
  	$input = $_POST['input name'];
  }
  
  ?>
Posted by: Guest on April-15-2021
-1

how to redirect to another page in php after submit

Right after @mail($email_to, $email_subject, $email_message, $headers);

header('Location: nextpage.php');

Note that you will never see 'Thanks for subscribing to our mailing list'

That should be on the next page, if you echo any text you will get an error because the headers would have been already created, if you want to redirect never return any text, not even a space!
Posted by: Guest on March-07-2021

Code answers related to "how redirect form on same page on submit in php"

Browse Popular Code Answers by Language