Page 1 of 1
Wrong Number error message
Posted: Sun Oct 19, 2008 10:04 pm
by AdRock
Script URL:
Version of script: 1.6
Hosting company:
URL of phpinfo.php:
http://www.operationbraveheart.org.uk/guestbook/
URL of session_test.php:
http://www.operationbraveheart.org.uk/guestbook/
What terms did you try when SEARCHING for a solution:
Write your message below:
I have had the same problem with security image not being displayed and when it does display I get the Wrong Number error message.
I have tried doing what you suggested in another post but it didn't work.
I have tested the GD because I get the red box with WORK in it. I know GD is installed as I have capthca images already working.
Here is the path to the session save folder
session_save_path('/home/davejump/public_html/guestbook/tmp');
I haven't changed anything else so i don't know why sometimes I could see the security image and other times i can't (especially after the wrong number error)
If you could please help me sort this problem out I would be very grateful.
I have uploaded those phpinfo files etc in the guestbook directory
Posted: Mon Oct 20, 2008 5:14 pm
by Klemen
Does it work if you completely remove
Code: Select all
session_save_path('/home/davejump/public_html/guestbook/tmp');
from your code (because session_test works fine)? Try it and make sure you close all browser windows before testing any changes.
If not are yo usure the tmp/ folder is writable (chmod to 666 (rw-rw-rw-))?
Posted: Mon Oct 20, 2008 8:17 pm
by AdRock
I removed that session path and it made no difference
I also checked that the tmp folder was 666 and that made no difference.
What is strange is when i click sign guestbook, i get the security image and when i enter the number, i then get the wrong security number error.
Can i remove that security check and use one i have elsewhere on my site?
I have a captcha image php file i use on registration and contact form and I never have problems with that.
This is a real nightmare as I have someone who wants to sign the guestbook
Posted: Wed Oct 22, 2008 5:20 pm
by Klemen
It's definitely a problem with sessions. Try uploading blank header and footer.txt files and see if that helps.
You can disable security number in the settings file ($settings['autosubmit'] to 0) but I can't help you add any other code, you're one your own there.
Posted: Wed Oct 22, 2008 8:59 pm
by AdRock
I did as you suggested and it works.
I have done some narrowing down and I think i know what's causing the problem and it is sessions like you said and as i suspected.
Becuase I have included some files such as database connection etc, one of them was causing problems
Code: Select all
error_reporting(E_ALL ^ E_NOTICE);
define('IN_SCRIPT',true);
require_once("../php/storeAddress.php");
require_once('../php/database/MySQL.php');
require_once('../php/database/connection.php');
require_once('../php/functions.php');
require('settings.php');
require($settings['language']);
$settings['verzija']='1.6';
I need to have session_start at the top of the page so i included a php file with this code in it
Code: Select all
if(ini_get('session.auto_start') == '0') session_start();
Could this be causing the error, as the session is being started twice? I don't get any warning about sessions already being started.
If this is what's causing it, how do i start sessions so i can use sessions I have created like user login?
Posted: Thu Oct 23, 2008 6:22 pm
by Klemen
That's exactly the problem, double sessions. It doesn't throw any errors because you probably have debug mode ($settings['debug']) set to 0 (disabled). You can try removing
, close all browser windows and see if that helps. If not you will need to remove one of the session_start()'s
Posted: Thu Oct 23, 2008 9:21 pm
by AdRock
I have tried removing all session_starts apart from the one i start at the top of gbook.php but it makes no difference.
If i remove the session_start() that i add, it works without altering the guestbook code but then i can't login from my site as the login is on every page in header.txt
I don't understand why when i include session_start() at the top of gbook.php, it doesn't get included elsewhere on the page to display the image.
I looked at all the code and including the session_start() i add, there is 2 more.....one in print_sec_image.php and the other after this
Code: Select all
$a=gbook_input($_REQUEST['a']);
/* And this will start session which will help prevent multiple submissions and spam */
if($a=='sign' || $a=='add') {
surely if it's included at the top, you shouldn't need to start the session again
Posted: Fri Oct 24, 2008 1:26 pm
by Klemen
Sorry, that code was for Linkman not GBook. Try removing this code from
gbook.php:
Code: Select all
session_name('GBOOK');
session_start();
And in
print_sec_img.php delete just
and leave session_start();
Posted: Fri Oct 24, 2008 7:36 pm
by AdRock
Many thanks...that's what i was trying to do last night but i couldn't get it working but it does now.....
