Jump to content

php generated forms not refreshing html img tag


warewolfe

Recommended Posts

Hi, I have a same-page form-display script that calls a function to generate a jpg. If the form hasn't been filled in it shows a default .jpg. The trouble is that when the submit button is pushed and the new .jpg is created the page itself doesn't change to show the new image. Is there a php solution or do I have to use javascript? 
Link to comment
Share on other sites

The problem is that cos the image is the same name, then when the users machine reads the data, it see's it has the image on the users machine

Simple solution, is to stop the cache

this is HTM META tag, place in the head of your wesbite

[code]
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
[/code]
Link to comment
Share on other sites

Thanks for the reply and it was a help, but default.jpg and the target.jpg did have different names. (Which was the bit that weirded me out). Your code does make the browser distinguish between default.jpg and target.jpg but if I update target.jpg with the same form it takes a manual refresh for the page to notice the difference.
 
Link to comment
Share on other sites

Got that, just trying to see if there was a non-javascript solution given that there is a form action going on and the page is renewing itself at least partially. I'm trying to understand why the page will not fully renew itself as the Headers for the target.jpg change on submit, but not the image itself. Even with the caching turned off.
Link to comment
Share on other sites

There is a setting in IE, which says if it should grab the images again, or use the system images

This is a nightmare, when working with GD Lib, as if your cropping / resizing images, it uses the local file, not the server file

To change this (for note)
On the File, Edit, View...
Click
Tools -> Internet Options

Then in the middle of the screen says, Temporary Internet Files,
and a button for Settings
Click Settings

Then you should have some radio buttons at the top,
My Default, this is set to Automatically.
Change this to
Every visit to every page

Solves the problem every time
But unless you want to tell your users to do this, I dont know
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.