addSlashes Question

From: Date: Wed, 01 Aug 2007 20:20:06 +0000
Subject: addSlashes Question
Groups: php.general 
Request: Send a blank email to php-general+get-260023@lists.php.net to get a copy of this message
Hi, Engaged in "cleanup" project, attempting to understand the uncommented decisions of predecessors. Inserting the following contact form values into a DB:
    $first = "'".addslashes($_POST['firstname'])."'";
    $last = "'".addslashes($_POST['lastname'])."'";
    $email = "'".addslashes($_POST['email'])."'";
    $address = "'".addslashes($_POST['address'])."'";
    $city = "'".addslashes($_POST['city'])."'";
    $state = "'".addslashes($_POST['state'])."'";
    $zip = "'".addslashes($_POST['zip'])."'";
    $comments = "'".addslashes($_POST['comments'])."'";
    $newsletter = "'".addslashes($_POST['signup'])."'";
    $contact = "'".addslashes($_POST['contact'])."'";
I can understand addSlashes for the first and last name, but question the need in the other variables, please inform. CK

« previous php.general (#260023) next »