$_SESSION['admin'] = 1; } $qs = ""; foreach ($cleaned as $k => $v) { if ($k != "username" && $k != "password" && $k != "redirect" && $k != "action") { $qs .= "{$k}={$v}&"; } } if (strpos($cleaned['redirect'], "?") !== false) { list($cleaned['redirect'], $redirqs) = explode("?", $cleaned['redirect']); $qs = $redirqs . "&" . $qs; } header("Location: {$cleaned['redirect']}?{$qs}"); } else { pg_close($conn); js_msg('Invalid login', $cleaned['redirect']); } } else { if (!isset($cleaned['redirect'])) { $cleaned['redirect'] = '/index.php'; } echo "<h1>Login</h1>\n"; echo "<form method='post' action='user.php?action=login&redirect={$cleaned['redirect']}'>\n"; ?> <label for="username">Username</label><br/> <input name="username" id="username" /><br/> <label for="password">Password</label><br/> <input name="password" id="password" type="password" /><br/> <input type="submit" value="Go!" /> <?php }
function redirectMsg($msg, $redirect) { js_msg($msg, $redirect); }
<?php $app_name = "phpJobScheduler"; $phpJobScheduler_version = "3.9"; // ------------------------------- include "functions.php"; $id = clean_input($_POST['id']); $dbc = dbc::instance(); $result = $dbc->prepare("select * from " . PJS_TABLE . " where id='{$id}' "); $rows = $dbc->executeGetRows($result); if (count($rows) < 1) { js_msg("There has been an error!"); } $row = $rows[0]; // check if its hours $interval_array = time_unit($row["time_interval"]); if (preg_match("/minute/", $interval_array[1]) > 0) { $minutes = $interval_array[0]; } else { $minutes = -1; } if (preg_match("/hour/", $interval_array[1]) > 0) { $hours = $interval_array[0]; } else { $hours = -1; } if (preg_match("/day/", $interval_array[1]) > 0) { $days = $interval_array[0]; } else { $days = -1; }