is it right way( safe) to assign post data value directly by name attibute value to a variable in
        Posted  
        
            by I Like PHP
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by I Like PHP
        
        
        
        Published on 2010-05-13T08:58:29Z
        Indexed on 
            2010/05/13
            9:14 UTC
        
        
        Read the original article
        Hit count: 141
        
php
i m working in PHP since one year, but now a days i got this way to assign post data value directly using name attribute . i m really curious to know the documentation about it.please refere me link regarding this .
i explain by example
here is my form
<form method="post" action="">
<input type="text" name="userName" id="userName">
<input type="submit" name="doit" value="submit">
</form>
to get the post data i always use
$somevar=mysql_real_escape_string($_POST['userName']);
but now i see another way
$somevar= "userName";
i just want to know that is it safe n easy way??
© Stack Overflow or respective owner