Blog
Developers
Careers
Support
Contact
Gossamer Threads
Solutions
Results
About
Mailing Lists
Resource Centre
Forum
Tools
Home
Who's Online
Tags
Favourites
Login
Forum Search
(
Advanced Search
)
This forum
This category
All forums
for
Home
:
Products
:
DBMan
:
Customization
:
Converting characters
Previous Thread
Next Thread
Print Thread
View Threaded
Mar 13, 1999, 7:57 PM
Katana Man
User
(324 posts)
Mar 13, 1999, 7:57 PM
Post #1 of 8
Views: 2980
Shortcut
Converting characters
If someone types a " is there a way to make the script convert it to a ' ?
Maybe:
$rec{'Description'} =~ s/"/'/g;
would that work ?
Mar 14, 1999, 7:59 AM
JPDeni
Veteran
/ Moderator
(8669 posts)
Mar 14, 1999, 7:59 AM
Post #2 of 8
Views: 2907
Shortcut
Re: Converting characters
In reply to
Yep. That'll work.
------------------
JPD
Mar 14, 1999, 6:13 PM
Katana Man
User
(324 posts)
Mar 14, 1999, 6:13 PM
Post #3 of 8
Views: 2909
Shortcut
Re: Converting characters
In reply to
Well it didn't work if I put in in the .pl file, but it did work when I put it in the .cgi file and used:
$in{'Description'} =~ s/"/''/g;
BTW, if you look closely, you'll notice I converted a " to 2 single 'quotes'. The output looks just like a real quote"
Problems solved.
[This message has been edited by Katana Man (edited March 14, 1999).]
Mar 15, 1999, 7:50 AM
JPDeni
Veteran
/ Moderator
(8669 posts)
Mar 15, 1999, 7:50 AM
Post #4 of 8
Views: 2911
Shortcut
Re: Converting characters
In reply to
Odd that it didn't work in the html.pl file. But whatever works! Congrats!!!
------------------
JPD
Mar 29, 1999, 4:50 PM
cypress
New User
(4 posts)
Mar 29, 1999, 4:50 PM
Post #5 of 8
Views: 2911
Shortcut
Re: Converting characters
In reply to
i need this feature too,
where EXACTLY do I put it in the script?
Mar 30, 1999, 1:00 AM
cypress
New User
(4 posts)
Mar 30, 1999, 1:00 AM
Post #6 of 8
Views: 2910
Shortcut
Re: Converting characters
In reply to
thanx, now i need to go the other way around.
we are building an events calendar and we need to sort an alphanumeric and display odd dates like "TBA"
so we want data in the database to convert on the fly:
"m-02" becomes "February"
can anyone help?
thanx
Mar 30, 1999, 7:23 AM
JPDeni
Veteran
/ Moderator
(8669 posts)
Mar 30, 1999, 7:23 AM
Post #7 of 8
Views: 2909
Shortcut
Re: Converting characters
In reply to
I'm not sure if I'm understanding you correctly, but if I am, you can make conversions in html.pl, sub html_record before the info is printed.
Just after
%rec = @_;
add your conversions like:
$rec{'Date'} =~ s/m-02/February/g;
The syntax is
s/[part you want replaced]/[what you want to replace it with]/g;
------------------
JPD
Mar 30, 1999, 9:21 AM
JPDeni
Veteran
/ Moderator
(8669 posts)
Mar 30, 1999, 9:21 AM
Post #8 of 8
Views: 2912
Shortcut
Re: Converting characters
In reply to
It would go in sub add_record, just before
$status = &validate_record;
------------------
JPD
Previous Thread
Next Thread
Print Thread
View Threaded