Re: How do YOU initialize the form variables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 31, 2007 12:57 pm, info@xxxxxxxxxxxxx wrote:
> username
> lastname
> mobile
> .. and so on ...
>
> Example simple initialization:
> // POST
> $username = $_POST['username'];
> $lastname = $_POST['lastname'];
> $mobile = $_POST['mobile'];

I personally go with:

<?php
   $username = isset($_POST['username']) ? $_POST['username'] : '';
   $username_html = htmlentities($username);
?>
<input name="username" value="<?php echo $username_html?>" />

I dunno that you want to go with what 95% of people go with -- There's
a LOT of bad scripts out there...

Maybe you should be looking at the best 5% of PHP coders, and see how
they do it instead. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux