<?php /* * Created on Oct 10, 2013 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ require ("common.php"); //$mySessionName = $_SESSION['UserName']; if (isset($_POST['Add'])){ $mySession = $_SESSION['user']['FullName']; //get the current user //mysql_select_db("tech_debt") or die("Could not connect to the database..".mysql_error()); $query = "INSERT INTO compliance_requirement (ComplianceID, ComplianceName, ComplianceGoal, ComplianceDescription, ComplianceStartDate, ComplianceEndDate, UserName) VALUES (NULL, :ComplianceName, :ComplianceGoal, :ComplianceDescription, :ComplianceStartDate, :ComplianceEndDate, :UserName)"; $query_params = array( ':ComplianceID' => '', ':ComplianceName' => $_POST['ComplianceName'], ':ComplianceGoal' => $_POST['ComplianceGoal'], ':ComplianceDescription' => $_POST['ComplianceDescription'], ':ComplianceStartDate' => $_POST['ComplianceStartDate'], ':ComplianceEndDate' => $_POST['ComplianceEndDate'], ':UserName' => $_POST['UserName'] ); try { // Execute the query to create the compliance $stmt = $db->prepare($query); $result = $stmt->execute($query_params); } catch(PDOException $ex) { die("Failed to run query: " . $ex->getMessage()); } // This redirects the user back to the login page after they register header("Location: createcompliance.php"); } ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)