Hey,
Wasn't entirely sure which forum this 1 should belong to.
I have a PHP script, which includes a Perl script that checks if the user is logged in, and prints the appropriate links.
If I run the PHP script when the user is logged in, the "logged out links" are displayed. If I run the Perl script directly when the user is logged in, the "logged in links" are displayed (expected result).
Any suggestion as to the reason why the Perl session variables are not found if the Perl script is included in a PHP script, but works fine when the Perl script is ran directly? Here is the PHP code leading up the the inclusion of the Perl script:
Thanks alot,
Chris
Wasn't entirely sure which forum this 1 should belong to.
I have a PHP script, which includes a Perl script that checks if the user is logged in, and prints the appropriate links.
If I run the PHP script when the user is logged in, the "logged out links" are displayed. If I run the Perl script directly when the user is logged in, the "logged in links" are displayed (expected result).
Any suggestion as to the reason why the Perl session variables are not found if the Perl script is included in a PHP script, but works fine when the Perl script is ran directly? Here is the PHP code leading up the the inclusion of the Perl script:
Code:
<?php
$current_url = '[URL unfurl="true"]http://'.$_SERVER[/URL]['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
$dirname = dirname($current_url);
// title and dirname fix when header is printed using LWP::Simple in a Perl script.
if (isset($_GET['Title'])) {
$title = $_GET['Title'];
$dirname .= '/..';
}
echo '<?xml version="1.0" encoding="ISO-8859-1"?>'.PHP_EOL;
?>
<!--<!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp;quot;[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;>-->[/URL]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>Title > <?php echo $title ?></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="NAC" content="GWKV4 RK6LD" />
<link rel="stylesheet" type="text/css" href="Include/Styles.css" title="" />
<!--[if lt IE 7]><style type=&amp;quot;text/css&amp;quot;>#left-col{width:200px;}#right-col{width:200px;}</style><![endif]-->
</head>
<body>
<noscript><p>Your browser does not support javascript or javascript has been disabled. As a result, particular features of this website may not work correctly.</p></noscript>
<div id="wrapper">
<div id="header">
<div id="left-logo">
</div>
<div id="right-title">
<h1>Title .co.uk</h1>
</div>
</div>
<div id="main">
<div id="left-col">
<div id="left-links">
<ul>
<li class="top <?php if (preg_match('/^A range/', $title)) { echo 'active'; } ?>"><a href="Home.php">Home ></a></li>
</ul>
<ul>
<li class="top <?php if (preg_match('/^eBooks/', $title)) { echo 'active'; } ?>"><a href="eBooks.pl?View=All">eBooks ></a></li>
[red]<?php $include_url = $dirname.'/Include/eBook-Links.pl'; include($include_url); ?>[/red]
Thanks alot,
Chris