|
Posted by ANTISPAM_garycnew_ANTISPAM on 12/15/05 12:37
I am trying to create/update a Php Session with Javascript to confirm
if users have Javascript enabled.
My first thought was to create a Javascript that writes a script tag
referencing a php page, which sets a $_SESSION variable.
javascript.js:
<script type="text/javascript">
<!--//
document.write('<s'+'cript type="text/javascript"
src="javascript.php"></s'+'cript>');
//-->
</script>
javascript.php:
<?php
session_start();
$_SESSION['javascript'] = 'enabled';
?>
I can see that both the javascript.js and javascipt.php files are
executing from the web logs, but when I try to query the
$_SESSION['javascript'] variable from another page $_SESSION is empty.
Is it possible to create/update a Php Session with Javascript?
Might it be done using URLEncoded URL, Javascript XMLHttpRequest, or
something of the like?
Thank you for your assitance.
Respectfully,
Gary
Navigation:
[Reply to this message]
|