cgi question kinda

R

robin

I know this may not be a question for this group, but is there some
kind of
secret involved in putting a new line into a single line (non-textarea)

input field on an html page, a special kind of character perhaps? I'm
using
CGI.pm for a script and I was wondering what that character is so I can

parse it out, remove them, etc... It really screws up my bbs script
when
someone does it. Thanks in advance- Robin
 
A

A. Sinan Unur

I know this may not be a question for this group,

Then why are you posting here.
but is there some kind of secret involved in putting a new line into a
single line (non-textarea)

Who knows? Why not ask a group that actually deals with HTML?
It really screws up my bbs script when someone does it.

If that is the only thing messing up your script, then your programming
must have improved at a super-human pace.

On the other hand, if such things are messing up your script, then your
script cannot be very good.

Sinan.
 
S

Scott Bryce

robin said:
I was wondering what that character is so I can parse it out, remove
them

I would think that if you have a Perl script that has a variable that
contains a string that contains an unknown character, you should be able
to write a routine that tells you what characters are in the string.
 
B

Brian Wakem

robin said:
I know this may not be a question for this group, but is there some
kind of
secret involved in putting a new line into a single line (non-textarea)

input field on an html page, a special kind of character perhaps? I'm
using
CGI.pm for a script and I was wondering what that character is so I can

parse it out, remove them, etc... It really screws up my bbs script
when
someone does it. Thanks in advance- Robin


I might have read this wrong but it seems to me you are asking how to remove
the newline from the end of a string that is submitted via a form. If this
is the case then -

$myvar =~ s!\n$!!;
 
D

David K. Wall

robin said:
I know this may not be a question for this group, but is there
some kind of secret involved in putting a new line into a single
line (non-textarea)

Only the Shadow knows.
input field on an html page, a special kind of character perhaps?
I'm using CGI.pm for a script and I was wondering what that
character is so I can parse it out, remove them, etc... It really
screws up my bbs script when someone does it. Thanks in advance-
Robin

Why not go about it the other direction? Define whch characters you
want to allow, and remove everything else.
 
R

Robin

Brian Wakem said:
I might have read this wrong but it seems to me you are asking how to
remove
the newline from the end of a string that is submitted via a form. If
this
is the case then -

$myvar =~ s!\n$!!;

there isn't a newline at the end of a string from a form field. The raw
data? is that what you mean?
-robin
 
R

Robin

A. Sinan Unur said:
Then why are you posting here.


Who knows? Why not ask a group that actually deals with HTML?

yeah, that's what I thought.
If that is the only thing messing up your script, then your programming
must have improved at a super-human pace.
hehehehehehe....

On the other hand, if such things are messing up your script, then your
script cannot be very good.

yeah, well, it's getting better.
 
B

Brian Wakem

Robin said:
there isn't a newline at the end of a string from a form field. The raw
data? is that what you mean?


No, and I have no idea what you mean.
 
C

Charlton Wilbur

BW> TIMTOWTDI

Yes, but they're not all good. What does your code do when the string
ends in \r\n on a platform where that's the line ending?

Charlton
 
B

Brian McCauley

Charlton said:
BW> TIMTOWTDI

Yes, but they're not all good.

Yes, and in this situation chomp() is one that is not good.
What does your code do when the string
ends in \r\n on a platform where that's the line ending?

We're talking in this thread about text submitted via an HTML form. As
such the EOL convention on the platform where the client is running is
irrelevant. Text from HTML forms (on confirming browsers) is always
"\cM\cJ" delimited and AFAIK CGI.pm does not tranlate the EOL to the
local platform's EOL.

Note also that "\n" is not necessarily "\cJ" on all platforms.

I'm not quite sure what you need to do if the server is on a EBCDIC
platform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top