cameeob2003 Posted August 17, 2006 Share Posted August 17, 2006 I have the following code:[code]<table width="13" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="13"><img src="images/index_15.gif" width="45" height="17" alt=""></td> <td><input type="text" name="email" value="" style="background:url(images/index_16.gif); width:137px; height:13px; border:none; font-size:9px;" /></td> <td><img src="images/index_17.gif" width="17" height="17" alt=""></td> </tr> </table></td> </tr> <tr> <td><table width="194" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="185"><img src="images/index_18.gif" width="201" height="5" alt=""></td> </tr> </table></td> </tr> <tr> <td><table width="188" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="44"><img src="images/index_19.gif" width="50" height="16" alt=""></td> <td width="136"><input type="submit" name="subscribe" value="" style="background:url(images/index_20.gif); width:58px; height:16px; border:none;" /></td> <td width="10"><img src="images/index_21.gif" width="7" height="16" alt=""></td> <td width="17"><input type="submit" name="unsubscribe" value="" style="background:url(images/index_22.gif); width:66px; height:16px; border:none;" /></td> <td><img src="images/index_23.gif" width="20" height="16" alt=""></td> </table>[/code]I want the three <input> areas to be in one form with 2 different options our outputs depending on the button you click. Is this possible it seems doable but is it? Quote Link to comment https://forums.phpfreaks.com/topic/17787-different-actions-2-buttons/ Share on other sites More sharing options...
Corona4456 Posted August 17, 2006 Share Posted August 17, 2006 Yes it is possible to do. There are different ways to do it depending on what action you want to happen when either or is clicked. You can use Javascript to handle client side changes on the page or php if it requires the server to handle the submission of the form. Quote Link to comment https://forums.phpfreaks.com/topic/17787-different-actions-2-buttons/#findComment-75961 Share on other sites More sharing options...
cameeob2003 Posted August 17, 2006 Author Share Posted August 17, 2006 How would i go about doing this. I have 2 diffent pages I want to redirect the user to depending on what they click. Quote Link to comment https://forums.phpfreaks.com/topic/17787-different-actions-2-buttons/#findComment-76438 Share on other sites More sharing options...
Daniel0 Posted August 19, 2006 Share Posted August 19, 2006 This will not solve your problem, but instead of using: [code]<input type="submit" name="unsubscribe" value="" style="background:url(images/index_22.gif); width:66px; height:16px; border:none;" />[/code] I think you should use: [code]<button type='submit' name='unsubscribe'><img src='images/index_22.gif' alt='unsubscribe'></button>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/17787-different-actions-2-buttons/#findComment-77167 Share on other sites More sharing options...
Corona4456 Posted August 21, 2006 Share Posted August 21, 2006 Using php you can easily redirect. In your php code just check to see what button was set in your $_POST variables.[code]if($_POST['buttonname1']){ header("Location: redirect1.html");}else if($_POST['buttonname2']){ header("Location: redirect2.html");}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/17787-different-actions-2-buttons/#findComment-78348 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.