Page 1 of 1

[SOLVED] need help with submit button

Posted: Thu Dec 11, 2003 10:43 am
by imme
Hi,
is there a possibility to have a submit button that (both) writes data to a mySQL database AND redirects to another page.

If I use JavaScript (Dreamweaver code) on the submit button, the PHP stuff on the page is not being executed.

Thank you for your help.

Posted: Thu Dec 11, 2003 10:59 am
by microthick
How about at the end of your php code you go:

Header("Location: http://yourwebsite.com/yourpage.html");

to redirect to yourpage.html.

Posted: Thu Dec 11, 2003 11:06 am
by imme
then I get an error saying:

Warning: Cannot modify header information - headers already sent by (output started at kontakt.php:7) in person_eingabe.php on line 51


btw, the file person_eingabe.php is being inserted into kontakt.php using include. the submit button is on person_eingabe.php.

Posted: Thu Dec 11, 2003 11:07 am
by JayBird
read this

viewtopic.php?t=1157

Mark

Posted: Thu Dec 11, 2003 11:27 am
by imme
great! works fine!

you guys are awesome!