|
-
Jun 22nd, 2001, 04:23 PM
#1
Thread Starter
New Member
CGI Q's
Hi,
A few Q's relating to some cgi problems which i would be grateful if u could solve:
- How do i loop through a file and if the string is not in the flat file then to append the string to the end of the file?
- How do i parse entered text and remove all extra lines and replace them with spaces?
Thanks
-
Jun 22nd, 2001, 08:37 PM
#2
sorry I don't have a clue on the first one, but the second one can go something like this
# make conversion of the newline character to breaks and paragraphs.
$as{'field_name'} =~ s/\n/-break-/g;
$as{'field_name'} =~ s/-break--break-/<p>/g;
$as{'field_name'} =~ s/-break-/<br>/g;
$as{'field_name'} =~ s/ +/ /g;
then you would write it to the file. is that what you're after?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|