• Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About grc

  • Rank
  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=""]here[/url].[/indent] I hope I've been able to help [img][/img]
  2. I strongly suggest that you use a javascript library, such as [url=""]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=""]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=""]article[/url]). There are many ways of detecting whether a feature is supported, including [url=""][/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][/img]