In other words, just do
$var = addslashes($POST['POST_var']);
$firstname = addslashes($POST['POST_firstname']);
$POST goes instead of $HTTP_POST_VARS... thats an old way of writing it. $POST is the new way. but remember its an ARRAY.
You can also just take a loop to take ALL POST variables and change them to simple variables like $var :
<?php
foreach($_POST as $key => $val){
$$key = addslashes($val);
}
?>
DO the addslashes script in the same page as the MySQL query, so, add it at the top of your script.
Then when you want to display it . Just in the page where they view it <?php
stripslashes(); ?> the mysql_fetch data.