// session_start(); include 'TPGP_db.php'; // self post data $iCancel = $_POST['Cancel']; $theStepId = $_POST['theStepId']; $SubStep = $_POST['SubStep']; $StepOrder = $_POST['StepOrder']; $Description = $_POST['Description']; $SubValue = $_POST['SubValue']; $theStepId = stripslashes($theStepId); $SubStep = stripslashes($SubStep); $StepOrder = stripslashes($StepOrder); $Description = stripslashes($Description); $SubValue = stripslashes($SubValue); $iCancel = stripslashes($iCancel); if ($iCancel == "Cancel"){ header("Location: TPGP_EditSubSteps.php"); } if ($SubStep) { $sql2 = "UPDATE sstep SET StepOrder='$StepOrder',SubStep='$SubStep',Description='$Description',SubValue='$SubValue' WHERE SStepID=" .$theStepId; mysql_query($sql2); header("Location: TPGP_EditSubSteps.php"); } else { // $PHP_SELF as the form action will cause the script to post to itself $StepID = $_GET['ID']; $sql3="SELECT SStepID, StepOrder,SubStep,Description,SubValue FROM sstep WHERE SStepID=" .$StepID; // echo $sql3; $result3 = mysql_query($sql3); $nrows = mysql_num_rows($result3); $row = mysql_fetch_array($result3); echo '