CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Using Perl programs from with a PHP environment.

Print topic Send  topic

Author Message
p3ptools

Posts: 19
Posted: 04/28/2004, 1:30 PM

Hello,

On *nix systems it is quite possible to mix both code charge generated PHP with
external Perl utilities to accomplish tasks such as PDF generation etc..

Cpan module

PHP::Session

should be installed. Note this is only a Perl module,
mod_perl or other objects that have implications for Apache and CGI are not required.

a sub-module provides a mechanism for un-serializing session files.

Here is a small snippet of code.

<CODE>

use strict;
use CGI;
use PHP::Session::Serializer::PHP;
use DBI;

my $query = new CGI;

my $serializer = PHP::Session::Serializer::PHP->new;

my $SESSIONID=$query->param('SESSIONID');
my $session_file = "/tmp/sess_" . $SESSIONID;
my $session;
my $UserLogin;
my $UserID;
my $sh;

open(S,"$session_file");
$session=<S>;
close(S);

$sh=$serializer->decode($session);

$UserLogin=$sh->{UserLogin};
$UserID=$sh->{UserID};

</CODE>

The variables $UserLogin and $UserID can then be
tested and compared against your database to
ensure that your Perl program is still running within the
session environment.

If your authentication tests fail then just redirect the browser
to your login page, (ala code charge - session verification).

I hope this is useful!

Stephen.


_________________
Sometimes the complaints will be false...
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.