ok exact problem !! Example data inputed via form : 'here is a quote "this Quote".' # which is passes to variable $document
if i use hidden fields in a html form to store these variables while the page displays a preview eg print "<input type=\"hidden\" name=\"hiddenField\" value=\"$document\">" the html page returned displays corectly and all data is in source eg <input type="hidden" name="hiddenField" value="here is a quote "this Quote".">" but when form is submited to cgi the data after the extra quote mark is missing the only solution i could think of was to replace the " in the data with ' but in an attempt to preserve data integrity is there another solution. if not how can i apply a regex to replace " with ' to all data wich is retrieved using CGI module. --------------- Kris G Findlay ----- Original Message ----- From: "Nikola Janceski" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 12, 2002 2:18 PM Subject: RE: Preview data > uh... Are you using the CGI module? > > This test CGI script can take 'hello " what?' > and when submitted will return the exact same thing. > What kinda problem are you really having? > > #!perl > use strict; > use warnings; > use CGI qw(:standard); > print header(); > if(param()){ > print param('crap'), p(); > > } else { > print start_form(); > > print textfield(-name =>'crap', > -size => 30), p(); > print submit(), p(); > print end_form(); > } > __END__ > > > -----Original Message----- > > From: drieux [mailto:[EMAIL PROTECTED]] > > Sent: Friday, April 12, 2002 9:04 AM > > To: [EMAIL PROTECTED] > > Subject: Re: Preview data > > > > > > > > On Friday, April 12, 2002, at 04:30 , Kris G Findlay wrote: > > > > > i'm writing a script that takes data submited by a form and > > adds it to a > > > mysql database > > > but i would like to be able to preview the data as it is to > > be displayed > > > before final submission to database. i have tried using hidden form > > > fields within a prieview page > > > but have a problem of these fields breacking when a " is > > included within > > > the data > > > > I ran into that as well.... What I had to do was write around it > > > > > > #---------------------- > > # a simple step forward to allow for "Andy R" expressions > > # a bit of overkill and all... > > > > sub dtk_retArray { > > > > my ($string) = @_; > > my @list; > > > > if ( $string =~ /".*"/ ) { > > my $tmp = $string; > > while ( $tmp ) { > > if ( $tmp =~ s/^"([\w\s]*)"\s*(.*)/$1 $2/) { > > $tmp = $2; > > push(@list, $1); > > } elsif ($tmp =~ s/(\w*)\s*(.*)/$1 $2/) { > > $tmp = $2; > > push(@list, $1); > > } > > } > > > > } else { > > @list = split(' ', $string); > > } > > > > @list; > > > > } # end of dtk_retArray > > > > > > I called that to check how a given textField had been set and > > whether or not it had " marks " - the twisted part was noticing > > that the way I had written the inner perl stuff meant that I > > could write 'perl syntax' pattern matching > > > > eg: search for "Andy R" or Andy\s*R .... > > > > > > ciao > > drieux > > > > --- > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -------------------------------------------------------------------------- -- > -------------------- > The views and opinions expressed in this email message are the sender's > own, and do not necessarily represent the views and opinions of Summit > Systems Inc. > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]