473,748 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generated file

Hello,

I am 99% sure that the problem I am having is not PHP related, but to
remove my doubt, I am posting here.

I have a search page (interfacing with MySql) that displays results in an
IFRAME on the search page. I did this so the whole page would not have to
be reloaded on each query.

Each time I query the DB, I write the result set to a file and include this
file as javascript source on the results page. Up to this point everything
works fine, which is why I say I don't think this is PHP related.

I use javascript to "walk" the recordset. In internet explorer (only), the
first query recordset is all that is ever seen by the search page, even
though the javascript source file is correctly generated. Maybe this is a
little opaque so I will give an example.

search.html
--
<IFRAME NAME="dataifram e" SRC="blank.html "></IFRAME>
[...]
<FORM ACTION="display .php" METHOD="post" TARGET="dataifr ame">
<INPUT TYPE="submit">
</FORM>

display.php
--
session_start ();
$filename = "tmp/" . session_id () . ".js";

// write recordset...
// include here
echo "<SCRIPT TYPE=\"text/javascript\" SRC=\"$filename \">

--
This file is always generated correctly. The problem arises when the
browser (IE) does not use the updated values in $filename. It is my belief
that IE caches the values in this file and when the frame is reloaded, IE
tries to be "smart" and sees that I am including the same file, and
therefore does not reload from the file but from its cache.

Now that I think about it, since the file is being correctly generated,
this is 100% NOT PHP related. Could someone shed light on this anyway? It
would be much appreciated.

Thanks,
Andrew
Nov 27 '05 #1
2 1511
*** Andrew Clark escribi/wrote (Sun, 27 Nov 2005 18:36:37 +0000):
It is my belief
that IE caches the values in this file and when the frame is reloaded, IE
tries to be "smart" and sees that I am including the same file, and
therefore does not reload from the file but from its cache.


I don't whether IE obeys date headers but you can tag the script document so it expires inmediately:

header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . ' GMT');
header('Expires : ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . ' GMT');
// HTTP/1.1
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);

// HTTP/1.0
header('Pragma: no-cache');
BTW, have you remembered to set the appropriate Content-Type header?

--
-+ lvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
--
Nov 27 '05 #2
Besides the comments of Alvaro on cacheing, you can see some additional
comments at http://php.net/imagecreatefrompng.

Another technique some people use (which I don't recommend for
production, but may be OK for testing) is to append a dummy query
string to the end of the main page with a random component: "?rubbish="
+ randomNumber(). This ensures that the page is not cached.

Csaba Gabor from Vienna

Andrew Clark wrote:
Hello,

I am 99% sure that the problem I am having is not PHP related, but to
remove my doubt, I am posting here.

I have a search page (interfacing with MySql) that displays results in an
IFRAME on the search page. I did this so the whole page would not have to
be reloaded on each query.

Each time I query the DB, I write the result set to a file and include this
file as javascript source on the results page. Up to this point everything
works fine, which is why I say I don't think this is PHP related.

I use javascript to "walk" the recordset. In internet explorer (only), the
first query recordset is all that is ever seen by the search page, even
though the javascript source file is correctly generated. Maybe this is a
little opaque so I will give an example.

search.html
--
<IFRAME NAME="dataifram e" SRC="blank.html "></IFRAME>
[...]
<FORM ACTION="display .php" METHOD="post" TARGET="dataifr ame">
<INPUT TYPE="submit">
</FORM>

display.php
--
session_start ();
$filename = "tmp/" . session_id () . ".js";

// write recordset...
// include here
echo "<SCRIPT TYPE=\"text/javascript\" SRC=\"$filename \">

--
This file is always generated correctly. The problem arises when the
browser (IE) does not use the updated values in $filename. It is my belief
that IE caches the values in this file and when the frame is reloaded, IE
tries to be "smart" and sees that I am including the same file, and
therefore does not reload from the file but from its cache.

Now that I think about it, since the file is being correctly generated,
this is 100% NOT PHP related. Could someone shed light on this anyway? It
would be much appreciated.

Thanks,
Andrew


Nov 28 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2601
by: Irmen de Jong | last post by:
Hello, I don't understand why the following doesn't work. What I want to do is dynamically import some generated Python code and I'm doing this using compile and exec'ing it in the dict of a new empty module object. That works okay, but as soon as the generated code tries do perform certain imports, it fails! Certain other imports succeed. Consider this example code:
1
2952
by: Reader | last post by:
Hello, I would like to know if there is a way to cache the xmlserializer-generated temp files and have the program reuse these cached files upon new application instances. For example, application 1 launches. The first time it uses the serializable classes the XmlSerializer will create a source file on the fly and compile it and use this file to serilize and deserilize the XML. When Application 1 is launched in a new instance say...
6
2305
by: Alan Krueger | last post by:
Is there a way to automatically include C# files (.cs) generated by a third-party tool into a Visual C# .NET build? It's possible the set of files generated by this tool might change. Adding these files manually to the project would work in the short term, but this would require manual intervention if these generated files happened to change, and I'd like to avoid any unnecessary manual steps. NAnt and similar tools can include and...
1
2301
by: Peter McEvoy | last post by:
Hi all, another question related to Schema and WSDL... I'd like to have a bit more control over the WSDL that is generated for my ..asmx. In particular, I'd like to override the generated WSDL with a handmade one that I want to provide. The reasons for this are: 1) My handmade WSDL (which will be based on the machine generated WSDL) will include alot more annotation elements - descriptions of the fields and types
27
13070
by: ted benedict | last post by:
hi everybody, i hope this is the right place to discuss this weird behaviour. i am getting dynamically generated text or xml from the server side using xmlhttprequest. if the server side data is STATIC, i can have whatever size of data i want. but if the data (xml or text) is generated dynamically using php, then there seems to be a size limit! xmlhttprequest's responseText is truncated, and the xml therefore not well fromed. in border...
4
2009
by: Fabio | last post by:
An ASP.NET 2.0 web site contains a web form and a web service. The web form consumes the web service. There is a Book class in the App_Code folder. The web service exposes a method that returns a Book object. The consumer includes a method that require a Book parameter. However the Book generated proxy class conflicts with the Book class in the App_Code folder. Please, consider the following code. I bet there is an easy way to solve this,...
1
1795
by: robc | last post by:
Hi, I am using the xsd.exe tool (in .NET 2.0) to generate C# classes from a set of schemas. Some of the XML types that I have defined are used by more than one schema. For maintenance purposes, I have placed these “common” types into their own schema and have imported them into the other schemas as needed. As a simple example, I have something like the following: Type1.xsd - defines a type called Type1 Type2.xsd -...
8
7044
by: Les Caudle | last post by:
Using this command line to run XSD.exe xsd /c /o:outputDir input.xsd /f on the following XSD <?xml version="1.0"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:dino="http://example.com/test" targetNamespace="http://example.com/test" elementFormDefault="qualified">
12
2812
by: webinfinite | last post by:
I am starting a new thread for this topic since previous problem has been solved. I have code like this: #include <stdio.h> int main(){
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.