data formats

I'm submitting form data which is a mixture of checkboxes and text inputs, some of which are integers and a couple text based. I am retrieving the data as follows:
$var = (int)!empty($_POST['var']); for checkboxes,
$var = (int)$_POST['var']; for integers and
$var = mysql_real_escape_string($_POST['var']);
Is this correct?


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Richard Dunne [ So, 20 Februar 2011 22:29 ] [ ID #2055539 ]
PHP » gmane.comp.php.database » data formats

Vorheriges Thema: Jquery
Nächstes Thema: Search relevance