grc

Members
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

102 Neutral

About grc

  • Rank
    Newbie
  1. You should probably change [php]$_SESSION[test][/php] to [php]$_SESSION['test'][/php] If that still isn't working, here are a few ideas you might want to try: [list][*]Add [font="Courier New"]error_reporting(E_ALL); [/font]straight after the [font="Courier New"]<?php [/font]line.[/list] [list][*]Check that cookies are enabled in your browser. You could also test it in a different browser (especially if you're using IE).[/list] [list][*]Make sure that the code you posted is the very first thing in each file (no whitespace or html before it).[/list] [list][*]Run this code:[/list][indent][php] <?php phpinfo(INFO_MODULES); ?> [/php] [/indent][indent]Skip down to the section titled 'session', and check that session support is enabled. If you have been messing around with the settings, you might want to compare them to the defaults found [url="http://php.net/manual/en/session.configuration.php"]here[/url].[/indent] I hope I've been able to help [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]
  2. I strongly suggest that you use a javascript library, such as [url="http://jquery.com/"]jQuery[/url]. jQuery is compatible with all recent browsers (and many old ones), and it makes writing in javascript significantly easier. The following code achieves what I think you're looking for. [color="#1C2837"][size="2"]It uses jQuery and it should work for all decent browsers.[/size][/color] [code]$(function() { $("#c").mousemove(function(e) { $("#x").html("Page X: " + e.pageX); $("#y").html("Page Y: " + e.pageY); }); });[/code] To answer your question, there are two ways to go about browser compatibility. Technically, you could use [font="Courier New"]$.browser[/font] to detect the browser and [font="Courier New"]$.getScript [/font][font="Arial"]to load a different script depending on the browser. However, [url="http://css-tricks.com/2090-browser-detection-is-bad/"]browser detection is generally considered to be a bad idea[/url]. [/font] [font="Arial"]The alternative is to test whether the features you need are supported ([url="http://quirksmode.org/js/support.html"]article[/url]). There are many ways of detecting whether a feature is supported, including [url="http://api.jquery.com/jQuery.support/"]jQuery.support[/url][/font] "If you always use object detection, your scripts will never generate any error messages, although they might not work in certain browsers." I hope I've been able to help [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]