if ($answer_counter == 1): ?>
endif; ?>
eval "'echo 'NL=qsq' | tr 'qs' '72''"; # newline
echo DB_NAME; read DB_NAME;
db_name_esc=$DB_NAME
db_name_esc=${db_name_esc//\/\\\\} # escape backslash
db_name_esc=${db_name_esc//\'/\\\'} # escape single quote
db_name_esc=${db_name_esc//\"/\\"} # escape double quote
db_name_esc=${db_name_esc//&/\&} # escape & special to sed
db_name_esc=${db_name_esc//\//\\/} # escape / special to s///
db_name_esc=${db_name_esc//${NL}/\${NL}} # esc literal newline for sed
# and then plug in your variables properly escaped for both PHP+sed
sed -e "
s/\(define('DB_NAME',\).*/\1 '$db_name_esc');/
" yourfile