Page 1 of 1

form problem

Posted: Thu Mar 20, 2008 7:59 am
by tabatsoy
Good Day Earthlings!!!
is it possible that if i press the submit button in a form it will redirect me in another page and still it will add in the database? if its possible, can someone please help me how to do that code.
thanks in advance :crazy:

Re: form problem

Posted: Thu Mar 20, 2008 8:27 am
by jamiller
Can you be more specific? Looks like you simply want to add an entry into a database?

Re: form problem

Posted: Thu Mar 20, 2008 8:33 am
by John Cartwright
Just have your processing page redirect somewhere after it's done processing.

Code: Select all

<?php
 
if (!empty($_POST)) { 
   //validate your form here
   $valid = true;
 
   if ($valid) { 
      //enter info into db if valid
      header('Location: http://someotherpage.com');
      exit();
   }
}
 
?>
 
<form>
  <input ... >
</form>