Jump to content

Update Script


h3ktlk

Recommended Posts

My problem here is... the if works at the top.. but when i hit register if it does not meet the if requirement i woul dlike it to go to another page and say whats wrong and why it did not take.. the way it setup here.. it auto goes to the second page because the default value for sessiona through d is not correspondent to the if statement.  Does the else statement need somewhere else?

 

 

if ($_POST['sessiona'] == "121" OR $_POST['sessionb'] == "221" OR $_POST['sessionc'] == "321" OR $_POST['sessiond'] == "421"){

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {

  $updateSQL = sprintf("UPDATE users SET tshirt=%s, sessiona=%s, sessionb=%s, sessionc=%s, sessiond=%s WHERE idusers=%s",

                      GetSQLValueString($_POST['Tshirt2'], "text"),

                      GetSQLValueString($_POST['sessiona'], "text"),

                      GetSQLValueString($_POST['sessionb'], "text"),

                      GetSQLValueString($_POST['sessionc'], "text"),

                      GetSQLValueString($_POST['sessiond'], "text"),

                      GetSQLValueString($_POST['idusers'], "text"));

 

  mysql_select_db($database_wellness, $wellness);

  $Result1 = mysql_query($updateSQL, $wellness) or die(mysql_error());

 

  $updateGoTo = "schedule.php";

  if (isset($_SERVER['QUERY_STRING'])) {

    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";

    $updateGoTo .= $_SERVER['QUERY_STRING'];

  }

  header(sprintf("Location: %s", $updateGoTo));

}

 

$colname_wellnessusers = "0";

if (isset($_SESSION['MM_Username'])) {

  $colname_wellnessusers = $_SESSION['MM_Username'];

}

}

else{

header("location: http://*****");}

 

 

 

 

?>

Link to comment
https://forums.phpfreaks.com/topic/99026-update-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.