// session_start(); include 'TPGP_db.php'; // self post data $iCancel = $_POST['Cancel']; $theSubmitAction = $_POST['Submit']; $theStepId = $_POST['theStepId']; $Step = $_POST['Step']; $StepOrder = $_POST['StepOrder']; $Description = $_POST['Description']; $SStepsRequired = $_POST['SStepsRequired']; $iCancel = stripslashes($iCancel); $theSubmitAction = $theSubmitAction; $theStepId = stripslashes($theStepId); $Step = stripslashes($Step); $StepOrder = stripslashes($StepOrder); $Description = stripslashes($Description); $SStepsRequired = stripslashes($SStepsRequired); // echo $PHP_SELF // THIS IS WHERE THE SELF POST FORM GOES // Define post fields into simple variables if ($iCancel == "Cancel"){ header("Location: TPGP_EditSteps.php"); } if ($theStepId){ if ($theSubmitAction=="Delete Step") { $sql2 = "DELETE FROM step WHERE StepID=" .$theStepId; mysql_query($sql2); header("Location: TPGP_EditSteps.php"); } else { header("Location: TPGP_EditSteps.php"); } } else { // $PHP_SELF as the form action will cause the script to post to itself $StepID = $_GET['ID']; $sql3="SELECT StepID, StepOrder,Step,Description,SStepsRequired FROM step WHERE StepID=" .$StepID; // BE SURE TO GO BACK AND LOOK FOR ALL THE RELATED UNITS AND DELETE THEM // $result3 = mysql_query($sql3); $nrows = mysql_num_rows($result3); $row = mysql_fetch_array($result3); echo '