// session_start(); include 'TPGP_db.php'; // self post data $iCancel = $_POST['Cancel']; $Submit = $_POST['Submit']; $TherapyID = $_POST['rid']; $StudentID = $_POST['sid']; $Description = $_POST['description']; $EndDate = $_POST['EndDate']; /* Let's strip some slashes in case the user entered any escaped characters. */ $TherapyID = stripslashes($TherapyID); $StudentID = stripslashes($StudentID); $Description = stripslashes($Description); $EndDate = stripslashes($EndDate); $iCancel = stripslashes($iCancel); if ($Submit == "Update Therapy") { $sql2 = "UPDATE therapy SET EndDate='$EndDate',description='$Description' WHERE therapyID=" .$TherapyID; mysql_query($sql2); // print ".$sql2"; $FURL = "TPGP_UpdateWeeklyPrograms.php?ID=" .$StudentID; header("Location:" .$FURL); } else { // $PHP_SELF as the form action will cause the script to post to itself if ($iCancel == "Cancel"){ $CURL = "TPGP_UpdateWeeklyPrograms.php?ID=" .$StudentID; header("Location:" .$CURL); } else { $TherapyID = $_GET['ID']; $sql3="SELECT StudentID, EndDate, description FROM therapy WHERE therapyID=" .$TherapyID; $result3 = mysql_query($sql3); $nrows = mysql_num_rows($result3); $row = mysql_fetch_array($result3); echo '