php - opencart 2.x: How to identify which submit button was pressed? -


on front page in opencart i've got panel login (which says user logged or if not asks login , password) , has if condition inside controller:

if (($this->request->server['request_method'] == 'post') && $this->validate()) { 

the contact page has same if condition. when press submit button on contact page, front page reloads , both controllers call validate() function after error in login panel. i'm thinking adding if condition check of submit button pressed? how manage this, login panel use same data when reloading when submit button contact page pressed?

if have these buttons:

<input type="submit" name="button1" /> <input type="submit" name="button2" /> 

then can test 1 clicked follows:

if (isset($_post['button1'])) {  } else if (isset($_post['button2'])) {  } 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -