cgi question kinda

Discussion in 'Perl Misc' started by robin, Mar 4, 2005.

  1. robin

    robin Guest

    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
    robin, Mar 4, 2005
    #1
    1. Advertising

  2. "robin" <> wrote in news:1109961408.385476.297040
    @g14g2000cwa.googlegroups.com:

    > 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.
    A. Sinan Unur, Mar 4, 2005
    #2
    1. Advertising

  3. robin

    Scott Bryce Guest

    robin wrote:

    > 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.
    Scott Bryce, Mar 4, 2005
    #3
  4. robin

    Brian Wakem Guest

    robin wrote:

    > 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$!!;


    --
    Brian Wakem
    Brian Wakem, Mar 4, 2005
    #4
  5. robin <> wrote:

    > 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.
    David K. Wall, Mar 4, 2005
    #5
  6. robin

    Shawn Corey Guest

    Brian Wakem wrote:
    >
    > $myvar =~ s!\n$!!;
    >

    chomp ($myvar);

    See perldoc -f chomp

    --- Shawn
    Shawn Corey, Mar 4, 2005
    #6
  7. robin

    Robin Guest

    thanks for all your help.
    -robin
    Robin, Mar 4, 2005
    #7
  8. robin

    Robin Guest

    "Brian Wakem" <> wrote in message
    news:...
    > robin wrote:
    >
    >> 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$!!;
    >
    >
    > --
    > Brian Wakem


    there isn't a newline at the end of a string from a form field. The raw
    data? is that what you mean?
    -robin
    Robin, Mar 4, 2005
    #8
  9. robin

    robin Guest

    good call.
    -robin
    robin, Mar 4, 2005
    #9
  10. robin

    Robin Guest

    "A. Sinan Unur" <> wrote in message
    news:Xns960F91D17DEasu1cornelledu@132.236.56.8...
    > "robin" <> wrote in news:1109961408.385476.297040
    > @g14g2000cwa.googlegroups.com:
    >
    >> 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?


    yeah, that's what I thought.

    >
    >> 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.


    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.

    >
    > Sinan.
    Robin, Mar 4, 2005
    #10
  11. robin

    Brian Wakem Guest

    Robin wrote:

    >
    > "Brian Wakem" <> wrote in message
    > news:...
    >> robin wrote:
    >>
    >>> 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$!!;
    >>
    >>
    >> --
    >> Brian Wakem

    >
    > 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.


    --
    Brian Wakem
    Brian Wakem, Mar 4, 2005
    #11
  12. robin

    Brian Wakem Guest

    Shawn Corey wrote:

    > Brian Wakem wrote:
    >>
    >> $myvar =~ s!\n$!!;
    >>

    > chomp ($myvar);
    >
    > See perldoc -f chomp



    TIMTOWTDI


    --
    Brian Wakem
    Brian Wakem, Mar 4, 2005
    #12
  13. Brian Wakem <> wrote:
    > Robin wrote:



    >> is that what you mean?

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



    That is typical of this OP.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 4, 2005
    #13
  14. >>>>> "BW" == Brian Wakem <> writes:

    BW> Shawn Corey wrote:

    >> Brian Wakem wrote:
    >>> $myvar =~ s!\n$!!;
    >>>

    >> chomp ($myvar);
    >>
    >> See perldoc -f chomp


    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

    --
    cwilbur at chromatico dot net
    cwilbur at mac dot com
    Charlton Wilbur, Mar 5, 2005
    #14
  15. Charlton Wilbur wrote:

    >>>>>>"BW" == Brian Wakem <> writes:

    >
    >
    > BW> Shawn Corey wrote:
    >
    > >> Brian Wakem wrote:
    > >>> $myvar =~ s!\n$!!;
    > >>>
    > >> chomp ($myvar);
    > >>
    > >> See perldoc -f chomp

    >
    > 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.
    Brian McCauley, Mar 6, 2005
    #15
  16. robin

    robin Guest

    **** that, no one is....
    -robin
    robin, Mar 10, 2005
    #16
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MM

    kinda "overloading"

    MM, Jul 27, 2004, in forum: VHDL
    Replies:
    1
    Views:
    459
    Jonathan Bromley
    Jul 28, 2004
  2. Weston Weems

    Page LifeCycle kinda complex

    Weston Weems, Aug 10, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    410
    Weston Weems
    Aug 10, 2004
  3. morc
    Replies:
    11
    Views:
    590
    Roedy Green
    Jan 26, 2006
  4. ChocoboMog123

    Kinda newb-ish question

    ChocoboMog123, Dec 12, 2003, in forum: Python
    Replies:
    8
    Views:
    311
    Hans Nowak
    Dec 13, 2003
  5. Mark Nold

    VERY newbie question -- kinda long

    Mark Nold, Apr 8, 2004, in forum: Javascript
    Replies:
    1
    Views:
    111
Loading...

Share This Page