有用的处理POST或者GET数据的程序

本程序实现两个功能:
   1、自定义变量名称。
   2、用addslashes函数处理变量值。
详细内容请看程序。程序源码及使用如下:
<html>
<?php
if ($HTTP_GET_VARS || $HTTP_POST_VARS)
{
    if (
$HTTP_GET_VARS)    {$varList $HTTP_GET_VARS;} 
    if (
$HTTP_POST_VARS) {$varList $HTTP_POST_VARS;} 
    foreach(
$varList as $key=>$value)
    { 
         
$newVar "form_" $key;       //改变变量名为form_+变量名     
        
$$newVar addslashes($value);  //用addslashes函数处理数据,便于操作数据库
    

 } 
?>
<?
echo $form_text_1;
echo 
'<p>';
echo 
$form_text_2;
?>
<form action="var.php" method="post">
<input type="test" name="text_1">
<input type="test" name="text_2">
<input type="submit" name="login" value="提交">
</form>
</html>