Posted by ANTISPAM_garycnew_ANTISPAM on 12/16/05 03:50
Here's the solution:
/includes/meta.php
<?php session_start(); if (!$_SESSION['javascript']) { ?><script
type="text/javascript" src="/js/javascript.php"></script><?php } ?>
/js/javascript.php
<?php
session_start();
if (($_COOKIE['PHPSESSID']) || ($_GET['PHPSESSID'])) { ?>
<!--//
document.write('<s'+'cript type="text/javascript"
src="/includes/javascript.php?PHPSESSID=<?php if
($_COOKIE['PHPSESSID']) { echo $_COOKIE['PHPSESSID']; } else { echo
$_GET['PHPSESSID']; } ?>"></s'+'cript>');
//-->
<?php } ?>
/includes/javascript.php
<?php
session_id($_GET['PHPSESSID']);
session_start();
$_SESSION['javascript'] = 'enabled';
?>
The meta.php script is a global include file that initiates a request
to js/javascript.php if the $_SESSION['javascript'] variable is not
found.
The js/javascript.php script then executes a javascript initiated
request to the includes/javascript.php script using the PHPSESSID
variable and updates the user's php session $_GET['PHPSESSID'] with
$_SESSION['javascript'] = 'enabled';
It does have a short coming in that the first loaded page will not show
that $_SESSION['javascript'] is set. Only pages loaded after the
initial page will be usefull.
Hope this helps someone else.
Respectfully,
Gary
[Back to original message]
|