Please insert username and password'; if (isset($_POST['login'])) { $username = trim(addslashes($_POST['username'])); $password = trim(addslashes($_POST['password'])); if ($username != '' && $password != '') { include 'open_connection.php'; $sql = "SELECT user_name, user_password, user_section, user_access FROM user WHERE user_name = '$username' AND user_password = '$password'"; $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); if (mysql_num_rows($result) == 1) { $_SESSION['isLogged_in'] = true; $_SESSION['username'] = $row['user_name']; $_SESSION['section'] = $row['user_section']; $_SESSION['access'] = $row['user_access']; //$_GET['kodpengguna'] = $row['kodpengguna']; //$kodpengguna = $_GET['kodpengguna']; if( $_SESSION['section'] == 'humancapital' && $_SESSION['access'] == 'admin' ) { // echo ""; } "; while($row = mysql_fetch_array( $result )) { Print ""; Print "" . $row['ID'] . ""; Print "" . $row['Name'] . ""; Print "" . $row['Telephone'] . ""; Print "" . $row['Birthday'] . ""; Print "" . "Edit" . ""; Print ""; } echo ""; /* TODO: 1.) When the page loads, retrieve data from database 2.) Populate the form with the retrieved data 3.) When the user is done with the editing and clicks on the Update button, should send all form data back to the database for updating 4.) Display message on whether update was successful or not */ ?>
edit_one.php: ">

  "; ?>

  "; ?>

  "; ?>