// session_start(); include 'TPGP_db.php'; // self post data $iCancel = $_POST['Cancel']; $theStepId = $_POST['theStepId']; $Step = $_POST['Step']; $StepOrder = $_POST['StepOrder']; $Description = $_POST['Description']; $SStepsRequired = $_POST['SStepsRequired']; $theStepId = stripslashes($theStepId); $Step = stripslashes($Step); $StepOrder = stripslashes($StepOrder); $Description = stripslashes($Description); $SStepsRequired = stripslashes($SStepsRequired); $iCancel = stripslashes($iCancel); if ($iCancel == "Cancel"){ header("Location: TPGP_EditSteps.php"); } if ($Step) { $sql2 = "UPDATE step SET StepOrder='$StepOrder',Step='$Step',Description='$Description',SStepsRequired='$SStepsRequired' WHERE StepID=" .$theStepId; mysql_query($sql2); 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; // echo $sql3; $result3 = mysql_query($sql3); $nrows = mysql_num_rows($result3); $row = mysql_fetch_array($result3); echo '