Example #1
0
FUNCTION Change_URL_Query() {
	GLOBAL $_SERVER;
	$new_query = "";

	$num_args = Func_Num_Args();
	$query = Explode("&", $_SERVER['QUERY_STRING']);

	FOR($i = 0; $i < Count($query); $i++) {
		$v = Explode("=", $query[$i]);
		$args[$v[0]] = $v[1];
		}

	FOR($i = 0; $i < $num_args;) {
		$args[Func_Get_Arg($i++)] = @Func_Get_Arg($i++);
		}

		WHILE($row = Each($args)) {
		IF($row[1] != "") {
			$new_query .= $row[0]."=".$row[1]."&";
			}
		}
		RETURN SubStr($new_query, 0, -1);
	}		
Example #2
0
 /**
  * Returns the data from the 'content-type' field. That is the boundary, charset and mime-type
  *
  * @param string $contentTypeStr "Content-type-string
  * @return array key/value pairs with the result.
  */
 public function getContentTypeData($contentTypeStr)
 {
     $outValue = array();
     $cTypeParts = GeneralUtility::trimExplode(';', $contentTypeStr, 1);
     // Content type, first value is supposed to be the mime-type, whatever after the first is something else.
     $outValue['_MIME_TYPE'] = $cTypeParts[0];
     reset($cTypeParts);
     next($cTypeParts);
     while (list(, $v) = Each($cTypeParts)) {
         $reg = '';
         preg_match('/([^=]*)="(.*)"/i', $v, $reg);
         if (trim($reg[1]) && trim($reg[2])) {
             $outValue[strtolower($reg[1])] = $reg[2];
         }
     }
     return $outValue;
 }
<?
IF($_POST['submit_lang']) {
	Print "submit_lang provedeno";
	$lang = $_POST['mlanguage'];
	UnSet($_POST['submit_lang']);
	UnSet($_POST['lang']);

	WHILE(List($var, $val) = Each($_POST)) {
		$val = VA_Escape_String($DB_hub, $val);
		$val = HTMLSpecialChars($val);
		$DB_hub->Query("REPLACE INTO va_languages (language, var, val) VALUES ('".$lang."', '".$var."', '".Trim($val)."')");
		}
	}

$result = $DB_hub->Query("SELECT var, val FROM va_languages WHERE language LIKE 'en'");
?>

<FORM action="index.php?q=lang_center" method="post">
<TABLE class="b1 fs10px">
	<TR>
		<TD class="bg_light right" colspan=3><INPUT class="w75px" name="submit_lang" type="submit" value="<?Print $text_send;?>"></TD>
	</TR><TR>
		<TD class="b bg_light right">&nbsp;<?Print $text_language;?>&nbsp;:&nbsp;</TD>
		<TD class="bg_light"><INPUT class="w300px" name="mlanguage" type="text" value="<?Print LANG;?>"></TD>
		<TD class="bg_light">&nbsp;</TD>
	</TR><TR>
		<TD class="b bg_light right">&nbsp;</TD>
		<TD class="b bg_light">&nbsp;</TD>
		<TD class="b bg_light">&nbsp;</TD>
	</TR><TR>
		<TD class="b bg_light right">&nbsp;<?Print $text_var;?>&nbsp;:&nbsp;</TD>
 public function FetchRow()
 {
     $fet = Each($this->QueryResult);
     return $fet['1'];
 }