php - How to detect if a button is clicked or not -


i have simple php coding problem here. have button id 'register' user click. code below not run once button clicked.

<?php try {   if (isset($_post['register'])) {     require_once('library.php');      $user_id = $identity->user_id;      $status_type = 'm';     $data = array('status' => $status_type);      $dbwrite->update('user', $data, "user_id = $user_id");      header('location: main.php');     exit;  }  } catch (exception $e) {   echo $e->getmessage(); } 

anyone can me ?

name attribute of button must missed. define button in html below

<input type="submit" name="register" value="register" /> 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -