Page 1 of 1

Security image problems in IE7 and FF2

Posted: Tue Mar 04, 2008 4:25 pm
by snarf
Script URL:gbook
Version of script:1.6
Hosting company:zenid.net
URL of phpinfo.php:http://www.jaframa.nl/contact/west/gast/phpinfo.php
URL of session_test.php:http://www.jaframa.nl/contact/west/gast ... n_test.php
What terms did you try when SEARCHING for a solution: security image, session cookie

Write your message below:
First of all a great script, simple but effective.
There's only one problem, in FireFox 2 the security image appearce after a refresh of the browser and in internet explorer 7 it dosn't show at all.

So in IE7 I cannot post a message at all and in FF2 after a refresh.
My script is running on a different server than where the web site I am linking from thats www.westenesch.nl/test see menu item gastenboek

I read that because of the session cookies it couldn't work like this but why can it work in FF (after a refresh) and not in IE7 (with or without a refresh)

Is something set wronly can I correct it myselff or must the host correct some items in the php configuration?

Kind regards
Frans de Vries

[edit-1]
Or to avoid this problem can I deactived the "security image" field. And where can I do this, I couldnot find an option for it in the settings.php

[edit-2]
To avoid this problem in FF2 and IE7 I deactivated the smilies and for the text "security image" I ask my visitirs to press F5 to do a refresh of their browser. Next to that I put the main index file to the same server as the guestbook. Now i'ts working after the refresh, somehow the session cookies are not working as they should do. It's not the most neat solution but for now its working. But still ";m waiting for a better solution.......who can help!

Posted: Thu Mar 06, 2008 10:51 am
by snarf
Nowbody an idea how to overcome this (I think) cookie problem :?:
Also entering the guestbook directly dosn't solve this problem, a refresh is still needed. When i'm entering the demo on this site its working instantly whithout refresh or other tricks.

kind regards
Frans de Vries

Posted: Thu Mar 06, 2008 2:58 pm
by Klemen
Try adding

Code: Select all

ini_set('session.use_trans_sid',0);
to top of gbook.php and print_sec_img.php, just after the <?php

Upload, close all browser windows and see if it helps.

Posted: Thu Mar 06, 2008 3:40 pm
by snarf
Klemen wrote:Try adding

Code: Select all

ini_set('session.use_trans_sid',0);
to top of gbook.php and print_sec_img.php, just after the <?php

Upload, close all browser windows and see if it helps.
Klemen

Unfortuanally it didn't help.

Kind regards
Frans

Posted: Thu Mar 06, 2008 5:55 pm
by Klemen
Hi,

Not sure what is wrong. I see your host has an extension called Suhosin which seems to modify the way sessions and cookies work. Not sure if this is causing problems, but it could be.

You can try if this makes any difference:
http://www.phpjunkyard.com/extras/gbook_nosrid.zip

If not you can try disabling the security image by setting $settings['autosubmit'] to 0.

Sorry I can't be of more help here. I will try to test the Suhosin extension myself over the weekend to see if this is causing problems.

Posted: Thu Mar 06, 2008 7:35 pm
by snarf
Klemen

I'll try your suggestions later on this evening and report it back asap.
This weekend I'm away for a short holiday so I cannot test anything else anyway, so take your time to look what the plugin does (I believe it's some kind of antispam/hacker tool)

Kind regads
Frans de Vries

Posted: Thu Mar 06, 2008 11:19 pm
by snarf
Klemen wrote: You can try if this makes any difference:
http://www.phpjunkyard.com/extras/gbook_nosrid.zip
Klemen

These modifications did the trick :D
It's working smoothly now, in IE7 as well as in FF2.
Thanks and have a nice weekend

Kind regards
Frans

Posted: Thu Jul 03, 2008 10:06 am
by xammo
I came to the following solution:

I've added an "id" to the img tag and then I set the src attribute again with javascript. I seems to work fine in FF and IE7 (I can't test IE6 because the one I have for testing doesn't admit cookies). This is a way to refresh the image without refreshing the entire page.

<p><img id="imgSecurityCode" src="print_sec_img.php" width="100" height="20" alt="'.$lang['t62'].'" style="border-style:solid; border-color:#000000; border-width:1px" /><br />
'.$lang['t56'].' <input type="text" name="mysecnum" size="10" maxlength="5" /></p>
<script type="text/javascript">document.getElementById("imgSecurityCode").src = "'print_sec_img.php?nocache='.time().'";</script>

I hope it helps.