Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] how do i pass a cgi value to embedded perl script.



******    message to minivend-users from Hans-Joachim Leidinger <jojo@buchonline.net>     ******

Syam Sundar Pannala schrieb:
> 
> ******    message to minivend-users from Syam Sundar Pannala <syam@c915525-a.sttln1.wa.home.com>     ******
> 
> > Then on page "mail_page.html" :
> >
> > [if value CustomerName ne ""]
> > [then]
> >    Yeah okay okay. I will send mail to appropriate people.
> 
> Thanks for the response.
> 
> However, i wanted to pass the value to the embedded perl so that i can
> send mail to the customer. Also, i can do some more validataion on the
> email address (and other inputs which i deleted for simplicity) if perl
> can see these values.
> 
> any ideas ?

Simply passing any cgi value to embedded perl script can do with this
simple example:

1) 

<FORM
ACTION="http://__SERVER_NAME____CGI_URL__/<the-pagename-with-the-embedded-perl>"
METHOD="POST">
<INPUT TYPE="text" NAME="var1" VALUE="" size=123>
<INPUT TYPE="text" NAME="var2" VALUE="" size=123>
<INPUT TYPE="text" NAME="var3" VALUE="" size=123>
<input type="submit" Name=mv_todo VALUE="Senden">
</FROM>

Do not edit "http://__SERVER_NAME____CGI_URL__/"; and change only
"<the-pagename-with-the-embedded-perl>"!

2) The file <the-pagename-with-the-embedded-perl>:

[perl arg="cgi scratch"]
         $Safe{'scratch'}->{"var1"}  = $Safe{'cgi'}->{"var1"};
         $Safe{'scratch'}->{"var2"}  = $Safe{'cgi'}->{"var2"};
         $Safe{'scratch'}->{"var3"}  = $Safe{'cgi'}->{"var3"};
         ...any perl stuff to do this and that with var1 etc., that you
wish...
"";
[/perl]

Using the value of var1, var2 etc. can be done with

[scratch var1]

for example

[if scratch var1 =~ /Syam/]
	<FONT SIZE="+2">Hello Syam!</FONT>
[else]
	You are not the Person Syam!
[/else]
[/if]

Regards,

	Joachim

-- 
-------------Hans-Joachim Leidinger---------------------


-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: