Dear All,

I have two files, usr_profile.php and edit_profile.php.
The former is for displaying the user's info viz 'Name', 'Email' etc while the latter is for editing the info available in the former. After editing the info in the edit_profile.php and submitting it, it gets redirected to the usr_profile.php.

The problem is with image (user photograph) upload. After uploading a new image, the new image doesnt get displayed in the usr_profile.php page unless it is refreshed manually.
I have already used,

header('Cache-Control: no-cache');
header('Pragma: no-cache');

in the usr_profile.php file, but to no avail.

Any suggestion would be greatly appreciated.


have you set the time for cache expiry ? We have discussed the same thing in this thread. . Try doing the same ! If that doesn't help, well, we have to wait for a php expert to answer.


Thanks for you reply.
I tried all that you said but couldnt succeed.
Also went through to the other threads you referred to.


I used

header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') .' GMT');
header('Cache-Control: cache');
header('Pragma: no-cache');
header('Cache-Control: post-check=0, pre-check=0', false);

and it worked for me!

Dear nav33n,

Thanks for your reply.
I finally succeeded after appending
?rand=<?=rand(1,1000);?> after the image name in the src attribute of img tag.
You can refer to and search for 'jbarbero' in that page.



thanks for the link as well.. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.