otuatail Posted January 25, 2010 Share Posted January 25, 2010 How do I detect which image button has been clicked in http://www.des-otoole.co.uk/cms/admin/pages.php Please this is doing my head in. Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 25, 2010 Author Share Posted January 25, 2010 Works in opera but not in IE8 ??? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 25, 2010 Share Posted January 25, 2010 http://www.php.net/manual/en/faq.html.php#faq.html.form-image Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 25, 2010 Author Share Posted January 25, 2010 yes but this dosn't help. It works in opera but not in IE8 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 25, 2010 Share Posted January 25, 2010 In addition to needing to access the image as submit buttons as $_POST['NewContent_x'] and $_POST['EditContent_x'], your page has 10 HTML validation errors, some of which might render it invalid in some browsers - http://validator.w3.org/check?uri=http%3A%2F%2Fwww.des-otoole.co.uk%2Fcms%2Fadmin%2Fpages.php&charset=%28detect+automatically%29&doctype=Inline&group=0 Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 25, 2010 Author Share Posted January 25, 2010 THis is getting silly. I can't find an error in this. I even deleteted all the code between <form> and </form> and it told me that there was an error with </form> Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 25, 2010 Author Share Posted January 25, 2010 Ok I thout you could have a form within a div <div> <form> </form> </div> I have corrected this error. I still cant get the submit buttons to echo in the next page in IE8. This works in FF and opera Quote Link to comment Share on other sites More sharing options...
haku Posted January 26, 2010 Share Posted January 26, 2010 if(isset($_POST['NewContent_x'])) Button NewContent was clicked. if(isset($_POST['EditContent_x'])) Button EditContent was clicked. Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 26, 2010 Author Share Posted January 26, 2010 No this definatly does not work. I have changed the code to isset() Works fine in Firefox, works fine in Opera. Does not work in IE*. This must be an IE8 problem Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 26, 2010 Share Posted January 26, 2010 Without seeing your code, no one can possibly tell you why it is not working. The information about using the _x variable name works in all browsers. Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 26, 2010 Author Share Posted January 26, 2010 Ok I have found a fix in the second page if(isset($_POST[NewContent_x])) $Button = "1"; if(isset($_POST[EditContent_x])) $Button = "2"; if($Button == 1) header('Location: NewContent.php'); if($Button == 2) header('Location: EditContent.php'); Desmond. Quote Link to comment Share on other sites More sharing options...
bombsquad Posted January 28, 2010 Share Posted January 28, 2010 if(isset($_POST['NewContent_x'])) Button NewContent was clicked. if(isset($_POST['EditContent_x'])) Button EditContent was clicked. this is the right and working code.. you made a hard coded way otuatail but the function is the same as haku. Quote Link to comment 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.