Hello - I am using the following redirect code (with mods as required for my site) in order to pass the window size value to PHP so I can call up the correct image set for the screen size. Unfortunately due to the server side re-direct the back button on IE no longer functions correctly (it loops back to the redirect). This is of course, unacceptable. If anyone has a solution, I'd love to hear it. Thanks.

Here's the code:

if (isset($GET['width']) AND isset($GET['height'])) {
// output the geometry variables
$resWidth = $GET['width'];
$resWidth = $
GET['height'];
if ($resWidth > 800){
$imageSet = "lg"; // use the larger versions of the image set
$tableWidth = 1020;
$styleSheet = "ncafp_lrg_screen_styles.css";
$tdWidth = $tableWidth/5;
$centerCell = 220;
$marginCells = 20;
}
else {
$imageSet = "r";
$tableWidth = 750;
$styleSheet = "ncafp_default_styles.css";
$margin = 5;
$tdWidth = $tableWidth/5; // outer table cell width
$centerCell = 180;
$marginCells = 5;
}
$prePage = $_GET['prePage'];
}
else {
// pass the geometry variables
// (preserve the original query string
// -- post variables will need to handled differently)

	  echo "<script language='javascript'>\n";
	  echo "  location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"
			   . "&width=\" + screen.width + \"&height=\" + screen.height + \"&prePage=\" + document.referrer;\n";
	  echo "</script>\n";
	  exit();
	}

$mainCells = ($tableWidth- ($centerCell + ($marginCells*2)))/2; // table width - the 2 5px margins and the 180ps center column equals width od the two main cells in the center table

    the reason I echo out the javascript for the redir. is so I can get the screen geometry vars from javascript. Using the header() wouldn't really solve the issue while still providing thiose vars

    thanks anyway, unless i am missreading your suggestion

    -KS

      You can pass the information via $POST and $GET

        I don't think I am following. Perhaps if you could write out an example? I don't know how to send $POST data without a form. I am currently useing $GET and I think that might be the biggest issue.

        I need javascript to get the client side data (becuase i am unaware of any php solution for this) then send it back to the same page so it can be used by the php to set up the page according to screen geometry all without confusing IE's delicate back button.

          Write a Reply...