Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 105,410 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,756 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Opera browser caches my validation image!

 
Reply to this topicStart new topic

Opera browser caches my validation image!

Dancia
post 26 Jun, 2008 - 09:42 AM
Post #1


D.I.C Head

**
Joined: 15 Jun, 2008
Posts: 53



Thanked 1 times
My Contributions


Ok the problem is that then someone visits my registration page, then function automatically regenerates the rand_image.gif image. Unfortunately if user didn't type it right, Opera catches the image and displays the same one, but my function has already generated another one. On pressing: index?action=register nothing changes! I think that's because Opera has integrated some king of image cathing. Weird stuff. The only thing that helps is pressing refresh button. (Actually there is cache images in Opera, then I even can't get desired effect by refreshing it if enabled!)

Any tips?

With firefox and ie everything is fine.

This post has been edited by Dancia: 26 Jun, 2008 - 09:44 AM
User is offlineProfile CardPM

Go to the top of the page


MitkOK
post 26 Jun, 2008 - 09:55 AM
Post #2


D.I.C Regular

Group Icon
Joined: 9 Aug, 2007
Posts: 267



Thanked 8 times

Dream Kudos: 225
My Contributions


HMTL
html
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">


PHP
php
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0;
?>


This post has been edited by MitkOK: 26 Jun, 2008 - 10:01 AM
User is online!Profile CardPM

Go to the top of the page

Dancia
post 26 Jun, 2008 - 10:19 AM
Post #3


D.I.C Head

**
Joined: 15 Jun, 2008
Posts: 53



Thanked 1 times
My Contributions


QUOTE(MitkOK @ 26 Jun, 2008 - 09:55 AM) *

HMTL
html
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">


PHP
php
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0;
?>




Already tried. Doesn't work ;/.

This post has been edited by Dancia: 26 Jun, 2008 - 10:22 AM
User is offlineProfile CardPM

Go to the top of the page

mocker
post 26 Jun, 2008 - 10:34 AM
Post #4


D.I.C Head

**
Joined: 14 Oct, 2007
Posts: 157



Thanked 4 times
My Contributions


You could append a random string to the end of the filename, or a timestamp..

<img src='rand_image.gif?q=psenfselkfnes'>
User is offlineProfile CardPM

Go to the top of the page

JBrace1990
post 26 Jun, 2008 - 11:18 AM
Post #5


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 290



Thanked 10 times

Dream Kudos: 350
My Contributions


mocker's idea is good... I would have suggested telling the user they have to refresh because it's client side >_>
User is offlineProfile CardPM

Go to the top of the page

Dancia
post 26 Jun, 2008 - 12:48 PM
Post #6


D.I.C Head

**
Joined: 15 Jun, 2008
Posts: 53



Thanked 1 times
My Contributions


mocker's idea doesn't work (but i didn't try data stamping, coz don't know how). So I will just leave note for opera users about this in help section.
User is offlineProfile CardPM

Go to the top of the page

born2c0de
post 26 Jun, 2008 - 11:11 PM
Post #7


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,716



Thanked 19 times

Dream Kudos: 2800

Expert In: C, C++, VB, VB.NET, C#, Java, x86 Assembly, Win32 API, Reversing

My Contributions


I'm no PHP expert, but I just want you to know that as an Opera user, I haven't had any problems with CAPTCHAs on any other website.

You're probably not implementing it right.

Try this instead.
php
<?php
session_start();
header("Expires: Mon, 27 Jun 2008 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
?>
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/20/08 05:22AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month