Note Submitter: fredrik dot ekengren at mandarinen dot se
----
In a project I was involved in, we needed to pass data from mod_php4 to mod_perl. We used apache_note() to do the work for us.
It took a little while to figure it out, but here's some sample code that could help anyone with the same problem.
From PHP file:
<?
apache_note("name", $HTTP_COOKIE_VARS["User"]);
// Put all post variables into apache notes
while (list($key,$value) = each($HTTP_POST_VARS))
apache_note($key, $value);
// Call perl script
virtual("/perl/some_script.pl");
$result = apache_note("resultdata");
?>
From Perl file:
# Get Apache request object
my $r = Apache->request()->main();
# Get passed data
my $name = $r->notes('name');
my $more_data = $r->notes('more_data');
# some processing
# Pass result back to PHP
$r->notes('resultdata', $result);
// Fredrik
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.