[SOLVED] need help with submit button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
imme
Forum Newbie
Posts: 14
Joined: Fri Nov 21, 2003 11:51 am

[SOLVED] need help with submit button

Post 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.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post 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.
imme
Forum Newbie
Posts: 14
Joined: Fri Nov 21, 2003 11:51 am

Post 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.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

read this

viewtopic.php?t=1157

Mark
imme
Forum Newbie
Posts: 14
Joined: Fri Nov 21, 2003 11:51 am

Post by imme »

great! works fine!

you guys are awesome!
Post Reply