All pastes #186847 Raw Edit

Someone

public text v1 · immutable
#186847 ·published 2006-09-30 14:32 UTC
rendered paste body
<?php
$types_to_register = array('GET', 'POST', 'SERVER');
foreach ($types_to_register as $type)
	{
	$arr = @${'HTTP_' . $type . '_VARS'};
	if (@count($arr) > 0)
		{
		// Escapa todas las variables del post, para que entren en mysql sin errores ( '  y ` )
		while(list($key,$value) = each($arr))
			{
			$valor_seguro=mysql_escape_string($value);
			if (!$let_htmlentities)
				$valor_seguro=encodeText($value);

			$$key=$valor_seguro;
			@${'HTTP_' . $type . '_VARS'}[$key]=$valor_seguro;
			@${"_".$type}[$key]=$valor_seguro;
			}
		}
	}

?>