Hello folks
Ok I need to pass my screen resolution value (that I get from JavaScript) to my php variable... of course without reposting )I hate redirects).
Let me explain better.
I am creating a 100% width portal.
Now my site looks just fine if viewed with resolution 1280x.....
Therefor I need to make some minor adjustments for minor resolutions.
Now I've managed to include CSS files like:
Code:
<script language="JavaScript1.2">
if (screen.width==1024){
document.write('<link href="hd/ci1024.css" rel="stylesheet">');
}else if (screen.width ==1280){
document.write('<link href="hd/ci1280.css" rel="stylesheet">');
}
</script>
Ok, so far so good.
But now for some other adjustments I just need to make different layouts. That's why I need to include diferent php script.
My site is constructed this way:
index.php
PHP Code:
<?
$pageTitle
="Home";
include_once(
getenv("DOCUMENT_ROOT")."/lib/config.inc.php");
$pagePic="";
$pageDescription="";
$pageKeywords="";
require_once(
$cnfg_head_file);
 
require(
CNFG_HOME."/main.inc.php");
 
require_once(
$cnfg_footer_file);
?>
now in head file I get this javascript value (screen_width).
I need to pass this to php. so I could use:
PHP Code:
require(CNFG_HOME."/main$RES.inc.php" ); 

Is this possible. I know for other pages is not difficult with use of cookies, sessions etc. But I need this for my first page (or better said - entry page).
I thought about to use flash. So I can pass myJS value to flash movie that will process it and write the value into the DB wich can be then easyly retrieved by PHP.
What do you think? are there any better ways to do the "magic" ??
Thank alot 4 your answers