Hi all.
I am still having problems trying to get my code to pass variables in order to set it up for two css style sheets and such.
I have a previous post but it stopped getting answered last night. and I couldn't stay awake to respond🙂
here is my home page:
<?php
if(!$_POST["getsize"])header("Location: getsize.htm");
$client_maxwidth = $_POST["maxwidth"];
$client_maxheight = $_POST["maxheight"];
if ($maxwidth > 1000) {
$table_width = "1000";
$_POST["table_width"];
}
if ($maxwidth < 1000) {
$table_width = "760";
$_POST["table_width"];
}
if ($table_width == 1000 ) {
$css_page = "tayhawk.css";
}
elseif ($table_width != 1000) {
$css_page = "tayhawk2.css";
}
//echo "maxwidth: $maxwidth<br>";
//echo "maxheight: $maxheight<br>";
// use these in the rest of your code.
// Get the Browser
//echo $_SERVER['HTTP_USER_AGENT'] . "<hr />\n";
$browser = get_browser();
foreach ($browser as $name => $value) {
print "<b>$name</b> $value <br />\n";
}
include "header.inc";
?>
<center><table width="98%" cellpadding="3" cellspacing="2" align="center" style="table-layout: fixed">
body info
<?php
include "footer.inc";
?>
</td>
</tr>
</table>
here is the get size.htm file:
<HTML>
<HEAD></HEAD>
<BODY onload="document.infoform.submit();">
<FORM NAME="infoform" ACTION="home.php" METHOD=POST>
<INPUT TYPE=HIDDEN NAME=getsize VALUE=true>
<script language="JavaScript">
<!--
document.write('<INPUT TYPE=HIDDEN NAME=maxwidth VALUE=\"' + screen.width + '\">');
document.write('<INPUT TYPE=HIDDEN NAME=maxheight VALUE=\"' + screen.height + '\">');
//-->
</script>
</FORM>
</BODY>
</HTML>
here is my header & buttons located there:
[/code]
<?php
global $maxwidth;
global $table_width;
global $css_page;
if ($maxwidth > 1000) {
$table_width = "1000";
}
if ($maxwidth < 1000) {
$table_width = "760";
}
if ($table_width == 1000 ) {
$css_page = "tayhawk.css";
}
elseif ($table_width != 1000) {
$css_page = "tayhawk2.css";
}
?>
<html>
<head>
<title>Tay Hawk Doors</title>
<LINK REL=StyleSheet HREF=" <?php echo($css_page); ?>" TYPE="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<BODY>
<table width="<?php echo($table_width); ?>" cellpadding="1" cellspacing="1" align="center" style="table-layout: fixed">
<tr width="100%">
<table width="100%" cellpadding="1" cellspacing="1" align="center" style="table-layout: fixed">
<tr width="100%">
<td>
<td align="left" width="78%"><img src="images/woodbanner.jpg" width="100%"></td>
<td align="right" width="10%"><p class="frontAddress">Robert G. Hawley <br>Tay Hawk Inc.<br><a href="mailto:bob@tayhawk.com">CONTACT</a></p></td>
<td align="right" width="12%"><img src="./images/logosquare.jpg" onClick="window.location.href='http://tayhawk.com'"></td>
</tr>
</table>
<table width="100%" cellpadding="1" cellspacing="1" style="table-layout: fixed">
<tr width="100%" align="left">
<td width="15%">
<button class="headerButton" onClick="window.location.href='home.php?css_page=<? echo ($css_page) ?>?table_width=<? echo ($table_width) ?>'">HOME</button>
</td>
<td width="15%">
<button class="headerButton" onClick="window.location.href='quality.php?css_page=<? echo ($css_page) ?>?table_width=<? echo ($table_width) ?>'">QUALITY</button>
</td>
<td width="15%">
<button class="headerButton" onClick="window.location.href='products.php?css_page=<? echo ($css_page); ?>?table_width=<? echo ($table_width); ?>'">PRODUCTS</button>
</td>
<td width="15%">
<button class="headerButton" onClick="window.location.href='order.php?css_page=<? echo ($css_page); ?>?table_width=<? echo ($table_width); ?>'">ORDER</button>
</td>
<td width="15%">
<button class="headerButton" onClick="window.location.href='contact.php?css_page=<? echo ($css_page) ?>?table_width=<? echo ($table_width) ?>'">CONTACT</button>
</td>
<td width="25%">
</td>
</tr>
</table>
[/code]
For some reason, it will now pass the correct table width and send it to the correct css style sheet for the home page, and even paste it into the URL fwhen another page is brought up by clicking a button....
But I'm still not getting the correct table width and css sheet for those other pages. Only for the home page.
It's been bugging me for days!!!
any help would be greatly appreciated!