kevinkhan Posted January 25, 2010 Share Posted January 25, 2010 for the form submit button i have <input class="send" type="image" src="images/submit.gif" name="submit" /></p> but when i check for this condition it doesn't recognize it if(isset($_POST['submit'])) Why is this and what other condition could i use.. The above works if i change type image to type submit.. Link to comment https://forums.phpfreaks.com/topic/189757-need-to-check-if-a-form-has-been-sumitted/ Share on other sites More sharing options...
akitchin Posted January 25, 2010 Share Posted January 25, 2010 you could try adding something to the value attribute of the input. i'm not sure if that would help for an "image" input type. perhaps simply use another one of the form elements? if it's the only form element, you could always add a hidden one. Link to comment https://forums.phpfreaks.com/topic/189757-need-to-check-if-a-form-has-been-sumitted/#findComment-1001412 Share on other sites More sharing options...
jl5501 Posted January 25, 2010 Share Posted January 25, 2010 I think the last answer is correct. You will get $_POST['submit'] set, if the field has a value Link to comment https://forums.phpfreaks.com/topic/189757-need-to-check-if-a-form-has-been-sumitted/#findComment-1001418 Share on other sites More sharing options...
manwhoeatsrats Posted January 25, 2010 Share Posted January 25, 2010 Just an observation. you do not have a value for your submit button. how can you have a post variable if it has no value.....I suppose it is possible it could be NULL or empty...... I would try to do this. <input class="send" type="image" src="images/submit.gif" name="submit" value="submit" /> Not sure if that will fix your issue....it might not Link to comment https://forums.phpfreaks.com/topic/189757-need-to-check-if-a-form-has-been-sumitted/#findComment-1001422 Share on other sites More sharing options...
kevinkhan Posted January 25, 2010 Author Share Posted January 25, 2010 Just an observation. you do not have a value for your submit button. how can you have a post variable if it has no value.....I suppose it is possible it could be NULL or empty...... I would try to do this. <input class="send" type="image" src="images/submit.gif" name="submit" value="submit" /> Yes this worked, Thanks... Link to comment https://forums.phpfreaks.com/topic/189757-need-to-check-if-a-form-has-been-sumitted/#findComment-1001424 Share on other sites More sharing options...
akitchin Posted January 25, 2010 Share Posted January 25, 2010 three cheers for repetition! marking as solved. Link to comment https://forums.phpfreaks.com/topic/189757-need-to-check-if-a-form-has-been-sumitted/#findComment-1001528 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.