echo "<hr>"; } //echo "you are here3! login page"; $a = $_GET['txtName']; $b = $_GET['txtCat']; $c = $_GET['txtSum']; PrintBug($a, $b, $c); ?> <?php //get data entered by user on insert bug page"; $a = $_GET['txtName']; $b = $_GET['txtSum']; $c = $_GET['txtCat']; //add data from addBugs.php page if (isset($_GET['txtName'])) { //ADD DATA TO DB addBug($db1, $a, $b, $c); } //display all bugs getBugsPrinted($db1); ?> </section> </main> <!--END OF MAIN --> <?php include "rguFooter.php"; ?>
//do nothing // loop through the superglobal GET array /*foreach ($_GET as $key => $value) { PrintKeyAndValue($key, $value); }*/ } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { // loop through the superglobal POST array /*foreach ($_POST as $key => $value){ PrintKeyAndValue($key, $value); }*/ //get data entered by user on insert bug page"; $name = $_POST['txtName']; $summary = $_POST['txtSum']; $category = $_POST['txtCat']; //ADD DATA TO DB addBug($db1, $name, $summary, $category); //redirects to showBugs page header('Location: showBugs.php'); } else { //redirects to index page header('Location: Index.php'); } ?> </section> </main> <!--END OF MAIN --> <?php include "rguFooter.php"; ?>