User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,988 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,790 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 427 | Replies: 5
Reply
Join Date: Nov 2007
Posts: 4
Reputation: paranjyoti is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paranjyoti paranjyoti is offline Offline
Newbie Poster

Image not getting refreshed automatically

  #1  
Dec 5th, 2007
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.

Regards,
Paranjyoti
Last edited by paranjyoti : Dec 5th, 2007 at 2:25 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Image not getting refreshed automatically

  #2  
Dec 5th, 2007
have you set the time for cache expiry ? We have discussed the same thing in this thread. http://www.daniweb.com/forums/thread99489.html . Try doing the same ! If that doesn't help, well, we have to wait for a php expert to answer.
Cheers,
Naveen
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Nov 2007
Posts: 4
Reputation: paranjyoti is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paranjyoti paranjyoti is offline Offline
Newbie Poster

Re: Image not getting refreshed automatically

  #3  
Dec 5th, 2007
Hi,

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

Regards,
Paranjyoti
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Image not getting refreshed automatically

  #4  
Dec 5th, 2007
I used
  1. header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  2. header('Last-Modified: ' . gmdate('D, d M Y H:i:s') .' GMT');
  3. header('Cache-Control: cache');
  4. header('Pragma: no-cache');
  5. header('Cache-Control: post-check=0, pre-check=0', false);
and it worked for me!
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Nov 2007
Posts: 4
Reputation: paranjyoti is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paranjyoti paranjyoti is offline Offline
Newbie Poster

Re: Image not getting refreshed automatically

  #5  
Dec 6th, 2007
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 http://in2.php.net/rand and search for 'jbarbero' in that page.

Thanks,
Paranjyoti
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Image not getting refreshed automatically

  #6  
Dec 6th, 2007
cool..

thanks for the link as well..
Last edited by nav33n : Dec 6th, 2007 at 9:21 am.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:31 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC