Jump to content

help please


h3ktlk

Recommended Posts

I have a php update script running thats grabbing information from 5 fields.. 4 of which are dropdowns... IM trying to make an if statment of some sort to ensure one of the four drop downs has a certain selection or it gives an error....

 

any help?

 

started by doing this but all it does is sets the value to what is shown

 

if ($_POST['sessiona'] = "121"){

Link to comment
https://forums.phpfreaks.com/topic/99017-help-please/
Share on other sites

heres what i have no.. problem is.. it sets sessiona auto to 121 and then reverts others back to default choice

 

 

 

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'];

  }

Link to comment
https://forums.phpfreaks.com/topic/99017-help-please/#findComment-506667
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.