weir-07
03-29-2009, 01:49 AM
Was wondering if you guys might be able to to help me out.
Currently stuck with part of a User Activation set up i have.
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "stage2b")) {
$updateSQL = sprintf("UPDATE accounts SET status=%s WHERE username=%s AND activate_code=%s",
GetSQLValueString($_POST['status'], "text"),
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($_POST['activatecode'], "text"));
mysql_select_db($database_STC, $STC);
$Result1 = mysql_query($updateSQL, $STC) or die(mysql_error());
//SUCCESS
if ($Result1 = mysql_query($updateSQL, $STC)) {
$updateGoTo = "regsystem.php?go=2complete"; }
//FAILURE
else $updateGoTo = "regsystem.php?go=2failure";
if (isset($_SERVER['QUERY_STRING']))
header(sprintf("Location: %s", $updateGoTo));
Basically i am trying to go to "2complete" if the UPDATE is a success - and go to "2failure" if it does not work.
Anybody got any ideas? I've had a look around these forums and been playing with it for a while - would be very great full to anybody would might be able to help! :)
NOTE: the script works fine whenever the right details are entered - however displays the Success page even when it doesn't update the account...
Currently stuck with part of a User Activation set up i have.
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "stage2b")) {
$updateSQL = sprintf("UPDATE accounts SET status=%s WHERE username=%s AND activate_code=%s",
GetSQLValueString($_POST['status'], "text"),
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($_POST['activatecode'], "text"));
mysql_select_db($database_STC, $STC);
$Result1 = mysql_query($updateSQL, $STC) or die(mysql_error());
//SUCCESS
if ($Result1 = mysql_query($updateSQL, $STC)) {
$updateGoTo = "regsystem.php?go=2complete"; }
//FAILURE
else $updateGoTo = "regsystem.php?go=2failure";
if (isset($_SERVER['QUERY_STRING']))
header(sprintf("Location: %s", $updateGoTo));
Basically i am trying to go to "2complete" if the UPDATE is a success - and go to "2failure" if it does not work.
Anybody got any ideas? I've had a look around these forums and been playing with it for a while - would be very great full to anybody would might be able to help! :)
NOTE: the script works fine whenever the right details are entered - however displays the Success page even when it doesn't update the account...