Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Accessing Single Parameters in Perl Script

Reply
Thread Tools

Accessing Single Parameters in Perl Script

 
 
Francis
Guest
Posts: n/a
 
      03-23-2005
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

 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      03-23-2005
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
 
Reply With Quote
 
 
 
 
Chris Mattern
Guest
Posts: n/a
 
      03-23-2005
> 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?"
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      03-24-2005
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
 
Reply With Quote
 
Francis
Guest
Posts: n/a
 
      03-24-2005
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

 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      03-24-2005
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
 
Reply With Quote
 
Francis
Guest
Posts: n/a
 
      04-04-2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue in executing more than one perl script from Single perl script nilesh.sonawane@gmail.com Perl Misc 3 11-01-2007 06:19 PM
More than a single script block within a single HEAD and BODY Water Cooler v2 Javascript 2 04-18-2006 11:00 AM
problem calling perl script from SOAP server perl script pj Perl Misc 3 04-09-2004 10:23 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57