When adding an entry in the database that contain the following signs: &, #, ', and others. It renders that particular line and lines following it uneditable. What can I do to the following code to allow editing lines with these characters in them? Thanks! LisaW
################################################################# # Open the database to write data, changing the neccesary lines # ################################################################# if ($input{'action'} eq 'add'){ open (DATABASE1,">>$database"); print DATABASE1 "$input{'ncompany_name'}|$input{'nstreet'}|$input{'nci +ty_st_zip'}|$input{'nphone'}|$input{'nfax'}|$input{'nwebsite'}|$input +{'nemail'}|$input{'ncategory'}|$input{'nstorefront'}|$input{'nlogo'}| +$input{'nalpha'}|$input{'nfirst_name'}\n"; close (DATABASE1); } ################################################################# # Open the database to write data, changing the neccesary lines # ################################################################# if ($input{'action'} eq 'delete'){ open (DATABASE,">$database"); @DB=<DATABASE>; foreach $rec (@ODB){ chomp($rec); ($company_name,$street,$city_st_zip,$phone,$fax,$website,$emai +l,$category,$storefront,$logo,$alpha,$first_name)=split(/\|/,$rec); if ($company_name eq $input{'company_name'} && $street eq $inp +ut{'street'} && $city_st_zip eq $input{'city_st_zip'} && $phone eq $i +nput{'phone'} && $fax eq $input{'fax'} && $website eq $input{'website +'} && $email eq $input{'email'} && $category eq $input{'category'} && + $storefront eq $input{'storefront'} && $logo eq $input{'logo'} && $a +lpha eq $input{'alpha'} && $first_name eq $input{'first_name'} ){ print DATABASE ""; }else{ print DATABASE "$company_name|$street|$city_st_zip|$phone|$fax +|$website|$email|$category|$storefront|$logo|$alpha|$first_name\n"; } } close (DATABASE); } ######################################## print "Location: $databaseview\n\n"; ######################################## # Code to get the data from GET & POST # ######################################## sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $input{$name} = $value; } }

In reply to Wierd DB Question by lisaw

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.