This isn't really a PHP problem but I figure someone here might have some advice for me. Here is a basic idea of what I wanna do:
1 page
2 buttons on page
1st button must have form action for current page
2nd button must redirect to another page but POST the category id
I did try use headers but web server where site is hosted has problems with headers. Besides I want the vars to remain POST. Using the header function makes them GET.
Anyone got any ideas for me? I can elaborate if you don't understand. Please help.
Multiple buttons posting to pages without multiple forms.
Moderator: General Moderators
-
DustParticle
- Forum Newbie
- Posts: 2
- Joined: Sun Nov 16, 2003 12:45 pm
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
It can be done with JavaScript:
Scorphus.
- Create a <form action="normal_post.php" ... /> with 2 buttons, one of them is <input type="submit" ... />
- The other button call a JavaScript function (onClick="javascript:submitForm(this.form);") that changes the <form>'s action= attribute to something else and submits it:
Code: Select all
function submitForm (form) { form.action = 'other_post.php'; form.submit(); return; }
Scorphus.
-
DustParticle
- Forum Newbie
- Posts: 2
- Joined: Sun Nov 16, 2003 12:45 pm