Accessing Single Parameters in Perl Script

F

Francis

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
 
G

Gunnar Hjalmarsson

Francis said:
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?
 
C

Chris Mattern

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?"
 
T

Tad McClellan

Francis said:
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.
 
F

Francis

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
 
T

Tad McClellan

Francis said:
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?
 
F

Francis

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

F.
Joe said:
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
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top