Skip to content

Instantly share code, notes, and snippets.

<?php
$fldID = $fld = $fldName = $fldType = $fldFmt = $fldNotNull = $fldInheritance = $fldDefault = $fldTypeOfEdit = $fldDoSearch = array();
$stringValue = htmlspecialchars(stripcslashes($srchPat[$j]), ENT_QUOTES);
$stringValue = addcslashes($stringValue, '$');
switch ($fldType[$i]) {
case 1: // Char
$result .= $fldNameTempl . "<br><input type='text' name='srchPat[" . $j . "]' size='50' maxlength='255' value='" . $stringValue . "'>" . $fld_suffix;
$j++;
break;
case 3: // Text
$result .= $fldNameTempl . "<br><input type='text' name='srchPat[" . $j . "]' size='50' maxlength='255' value='" . $stringValue . "'>" . $fld_suffix;
switch ($fldType[$i]) {
case 1: // Char
$result .= $fldNameTempl . "<br><input type='text' name='srchPat[" . $j . "]' size='50' maxlength='255' value='" . htmlspecialchars(stripcslashes($srchPat[$j]), ENT_QUOTES) . "'>" . $fld_suffix;
$j++;
break;
case 3: // Text
$result .= $fldNameTempl . "<br><input type='text' name='srchPat[" . $j . "]' size='50' maxlength='255' value='" . htmlspecialchars(stripcslashes($srchPat[$j]), ENT_QUOTES) . "'>" . $fld_suffix;
$j++;
break;
case 6: // File
switch ($fldType[$i]) {
case 1: // Char
$result .= $fldNameTempl . "<br><input type='text' name='".$srchPatName."[" . $j . "]' size='50' maxlength='255' value='" . htmlspecialchars(stripcslashes($srchPatValues[$j]), ENT_QUOTES) . "'>" . $fld_suffix;
$j++;
break;
case 3: // Text
$result .= $fldNameTempl . "<br><input type='text' name='".$srchPatName."[" . $j . "]' size='50' maxlength='255' value='" . htmlspecialchars(stripcslashes($srchPatValues[$j]), ENT_QUOTES) . "'>" . $fld_suffix;
$j++;
break;
case 6: // File
$stringValue = htmlspecialchars(stripcslashes($srchPatValues[$j]), ENT_QUOTES);
$stringValue = addcslashes($stringValue, '$');
switch ($fldType[$i]) {
case 1: // Char
$result .= $fldNameTempl . "<br><input type='text' name='".$srchPatName."[" . $j . "]' size='50' maxlength='255' value='" . $stringValue . "'>" . $fld_suffix;
$j++;
break;
case 3: // Text
$result .= $fldNameTempl . "<br><input type='text' name='".$srchPatName."[" . $j . "]' size='50' maxlength='255' value='" . $stringValue . "'>" . $fld_suffix;
$j++;