How do i ensure that whatever case user enter into my form are submitted to mysql as uppercase.
Would appreciate if anyone could give some pointers. Many thanks.
This is the code:
Code: Select all
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO parts (MPN, MFR, DATECODE, `DESCRIPTION`, TOTAL) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['MPN'], "text"),
GetSQLValueString($_POST['MFR'], "text"),
GetSQLValueString($_POST['DATECODE'], "text"),
GetSQLValueString($_POST['DESCRIPTION'], "text"),
GetSQLValueString($_POST['TOTAL'], "text"));
mysql_select_db($database_quiksol, $quiksol);
$Result1 = mysql_query($insertSQL, $quiksol) or die(mysql_error());
$insertGoTo = "masterdetails.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Part No:</td>
<td><input type="text" name="MPN" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Manufacturer:</td>
<td><input type="text" name="MFR" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Date Code:</td>
<td><input type="text" name="DATECODE" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Description:</td>
<td><input type="text" name="DESCRIPTION" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Quantity:</td>
<td><input type="text" name="TOTAL" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Add Part" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form></td>