Accessing Single Parameters in Perl Script

Discussion in 'Perl Misc' started by Francis, Mar 23, 2005.

  1. Francis

    Francis Guest

    I do not know Perl but am taking a crash course in it. So far I have
    managed to accomplish writing a script that sends an email to my
    customer once their order is processed. I think I am doing pretty good
    but...

    Trouble is I now found out I have to access tghe customers email
    address as a HTTP POST parameter from the page that calls my perl url.
    Can anyone please tell me how I can accomplish this and whether I need
    to do any string formatting with the paramater value (being that it wil
    be an email address?).

    Any help appreciated. I am dsperate as I am without an ecommerce
    solution until I can solve this.

    Francis
    Francis, Mar 23, 2005
    #1
    1. Advertising

  2. Francis wrote:
    > I do not know Perl but am taking a crash course in it.


    Please take a course in how to post to Usenet, too.

    http://www.catb.org/~esr/faqs/smart-questions.html

    > Trouble is I now found out I have to access tghe customers email
    > address as a HTTP POST parameter from the page that calls my perl url.
    > Can anyone please tell me how I can accomplish this and whether I need
    > to do any string formatting with the paramater value (being that it wil
    > be an email address?).


    Not sure I understand what you are saying, but you'd probably study the
    docs for the CGI.pm module:

    perldoc CGI

    > I am dsperate as I am without an ecommerce
    > solution until I can solve this.


    What relevance has that to your problem?

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Mar 23, 2005
    #2
    1. Advertising

  3. > Francis wrote:
    >> I do not know Perl but am taking a crash course in it.

    >
    >> I am dsperate as I am without an ecommerce
    >> solution until I can solve this.

    >

    Someone who is "taking a crash course" putting up an e-commerce
    CGI site. Oh my.

    --
    Christopher Mattern

    "Which one you figure tracked us?"
    "The ugly one, sir."
    "...Could you be more specific?"
    Chris Mattern, Mar 23, 2005
    #3
  4. Francis <> wrote:

    > I do not know Perl but am taking a crash course in it.



    There are many things that are much more important to an ecommerce
    solution than the mere choice of programming language.

    Are you using taint checking? (Do you even know what it is?)

    Are you implementing file locking?

    Using encryption of sensitive data?


    You better be doing more than all of that or you will lose money,
    be hacked or sued, or some other unappealing outcome.

    Be careful out there...


    > Trouble is I now found out I have to access tghe customers email
    > address as a HTTP POST parameter from the page that calls my perl url.



    perldoc -q form

    What is the correct form of response from a CGI script?

    How do I automate an HTML form submission?

    How do I make sure users can't enter values into a form that cause my
    CGI script to do bad things?

    How do I decode a CGI form?


    > Can anyone please tell me how I can accomplish this



    By checking the Perl FAQ.

    You are expected to do that *before* posting you know...


    > I am dsperate



    But we are not.

    It does not have any bearing on whether to answer or skip your post.


    > as I am without an ecommerce
    > solution until I can solve this.



    If you are truly desperate and it is costing you money, then you
    are taking the wrong approach. You should hire someone that already
    knows this stuff to get it done for you.

    If you are not truly desperate or it is not costing you money,
    then please stop trying to fool us.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 24, 2005
    #4
  5. Francis

    Francis Guest

    I didn't make myself understood in my initial post. Sorry. I have
    signed up with an ecommerce provider and they are handling everything
    except the issuing of codes, which I am attempting to handle
    automatically using a perl script.

    The perl script I have written sends the customer an email and
    password. I have this working fine but do not know how to get the
    customers email address as a (environment?) variable into my perl
    script. I am told (by my ecommerce people) that it the parameter is
    included in the HTTP POST. I gather that this can be accessed in the
    perl script and the parameter(s) extracted.

    This is the problem as best I know to describe it.

    Francis
    Francis, Mar 24, 2005
    #5
  6. Francis <> wrote:

    > but do not know how to get the
    > customers email address as a (environment?) variable



    No, form parameters for GET are in an env var, form parameters
    for POST are on STDIN.

    This has nothing to do with Perl, the form parameters go there
    no matter what programming language you have chosen.


    > I am told (by my ecommerce people) that it the parameter is
    > included in the HTTP POST.


    How do I decode a CGI form?


    > This is the problem as best I know to describe it.



    Then the problem has been solved in an earlier followup, via
    a reference to the Perl FAQ.

    So why are you posting about it again?

    Did you read those FAQ answers?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 24, 2005
    #6
  7. Francis

    Francis Guest

    Thanks Joe. I think I got there in the end.

    F.
    Joe Smith wrote:
    > Francis wrote:
    > > I am told (by my ecommerce people) that it the parameter is
    > > included in the HTTP POST. I gather that this can be accessed in

    the
    > > perl script and the parameter(s) extracted.

    >
    > Baby steps.
    >
    > First, learn how to create a simple CGI that processes a simple POST.
    > You need to get experience with simple CGI-in-Perl tutorials before
    > tackling the ecommerce problem.
    > -Joe
    Francis, Apr 4, 2005
    #7
    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. Wet Basement
    Replies:
    1
    Views:
    2,517
    BobMonk
    Jul 15, 2003
  2. dpackwood
    Replies:
    3
    Views:
    1,792
  3. pj
    Replies:
    3
    Views:
    284
  4. Replies:
    3
    Views:
    185
    Josef Moellers
    Nov 1, 2007
  5. Water Cooler v2
    Replies:
    2
    Views:
    465
    Water Cooler v2
    Apr 18, 2006
Loading...

Share This Page