Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: question about forwarding variables to php from perl

by Roger (Parson)
on Dec 15, 2003 at 08:11 UTC ( [id://314780]=note: print w/replies, xml ) Need Help??


in reply to question about forwarding variables to php from perl

How about a perl script that reads STDIN for the Email text, and then forward to a php CGI via a POST method.

use strict; use warnings; use LWP::UserAgent; use HTTP::Request; # get email from STDIN my $email = do { local $/; <STDIN> }; # do the parsing of EMAIL here... # ... # build variables to pass to PHP via post # var1, var2 are CGI variables my %vars = ( var1 => $var1, var2 => $var2, # ... ); # send the POST to php my $url = "http://server/cgi-bin/script.php"; my $us = new HTTP::Request; my $res = $us->post($url, \%vars);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://314780]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2025-01-18 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (56 votes). Check out past polls.