note 14252 added to function.apache-note.php
| From: | fredrik dot ekengren at mandarinen dot se | Date: | Tue, 24 Jul 2001 08:45:01 +0000 |
| Subject: | note 14252 added to function.apache-note.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15754@lists.php.net to get a copy of this message | ||
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
http://www.php.net/manual/en/function.apache-note.php