|
Posted by ctiggerf on 09/20/06 15:46
Hmm .. I don't think your problem is the caching at all. But you
didn't supply any code to us so we could actually see it for ourselves.
But curious as I was, I put together a simple example that would show
how someone might accomplish this. Granted there may be much better
ways to accomplish this ... but:
frames.html
---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD><TITLE>PHP Frame Example</TITLE></HEAD>
<FRAMESET cols="20%, 80%">
<FRAME src="links.html" name="links_frame">
<FRAME src="detail.php" name="details_frame">
</FRAMESET>
</HTML>
---
links.html:
---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
- <a href="detail.php?id=1" target="details_frame">Row 1</a><br>
- <a href="detail.php?id=2" target="details_frame">Row 2</a><br>
- <a href="detail.php?id=3" target="details_frame">Row 3</a><br>
- <a href="detail.php?id=4" target="details_frame">Row 4</a><br>
- <a href="detail.php?id=5" target="details_frame">Row 5</a><br>
- <a href="detail.php?id=11" target="details_frame">Row 11</a><br>
- <a href="detail.php?id=12" target="details_frame">Row 12</a><br>
- <a href="detail.php?id=13" target="details_frame">Row 13</a><br>
- <a href="detail.php?id=14" target="details_frame">Row 14</a><br>
- <a href="detail.php?id=15" target="details_frame">Row 15</a>
</body>
</html>
---
detail.php:
---
<?php
//need a session to store which ones are already highlighted
session_start();
$set=$_SESSION['set'];
//see if anything was given to highlight/de-highlight
if(isset($_GET['id'])) {
//see if the id is already set
$pos = strpos($set, ':'.$_GET['id'].':');
if($pos === false) {
//not in the string so put it there
$set .= ':'.$_GET['id'].':';
} else {
//in the string so remove it
$set = str_replace(':'.$_GET['id'].':',"",$set);
}
//now update the session
$_SESSION['set']=$set;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<style type="text/css">
.h { background-color:#CCCCFF; }
</style>
<table border="1" cellpadding="3" cellspacing="0">
<tr<?php echo strpos($set, ':1:') !== false ? " class='h'" : '';
?>><td>Row1</td><td>value1</td></tr>
<tr<?php echo strpos($set, ':2:') !== false ? " class='h'" : '';
?>><td>Row2</td><td>value2</td></tr>
<tr<?php echo strpos($set, ':3:') !== false ? " class='h'" : '';
?>><td>Row3</td><td>value3</td></tr>
<tr<?php echo strpos($set, ':4:') !== false ? " class='h'" : '';
?>><td>Row4</td><td>value4</td></tr>
<tr<?php echo strpos($set, ':5:') !== false ? " class='h'" : '';
?>><td>Row5</td><td>value5</td></tr>
<tr<?php echo strpos($set, ':11:') !== false ? " class='h'" : '';
?>><td>Row11</td><td>value11</td></tr>
<tr<?php echo strpos($set, ':12:') !== false ? " class='h'" : '';
?>><td>Row12</td><td>value12</td></tr>
<tr<?php echo strpos($set, ':13:') !== false ? " class='h'" : '';
?>><td>Row13</td><td>value13</td></tr>
<tr<?php echo strpos($set, ':14:') !== false ? " class='h'" : '';
?>><td>Row14</td><td>value14</td></tr>
<tr<?php echo strpos($set, ':15:') !== false ? " class='h'" : '';
?>><td>Row15</td><td>value15</td></tr>
</table>
</body>
</html>
---
(This can be viewed at
http://www.eadexchange.com/test/frames/frames.html)
Seems to work fine for me and I don't see any caching issues at all.
So perhaps if you post some code, we can see what you have going on,
and then we may be able to help you. Generally you should always come
up with a simple example that highlights your problem. Because from
just reading your post, (I hate to say it) it doesn't look like a php
problem. Unless your script is jacked, in which case we would need to
see the code.
Another reason that making a simple example is a good idea: I can't
remember how many times in making a simple example, I've solved my
problem. Also people don't have to try and guess what's going on.
One problem you might want to look at is where you are starting your
session (if you're using one, which we wouldn't have to guess if you
supplied example code). It needs to be the first line of code you
execute and come before any html is printed out. In other words you
can't to this:
<html><head>
<?php session_start(); ?>
.....
[Back to original message]
|