Not logged in. · Lost password · Register
Forum: I NEED HELP!!!!!! Scripting Help RSS
error in name field after adding Image Verification script
Avatar
keybush #1
Member since Feb 2005 · 4 posts · Location: Maryland
Group memberships: Members
Show profile · Link to this post
Subject: error in name field after adding Image Verification script
I added the Image Verification mod on my site, but am now getting this error after I submit a test comment in the guestbook:

Guestbook - Error
You forgot to fill in the Name field. Please correct it and re-submit.

The image verification field is loading properly, but after submitting post, error indicates the Name field was not filled in (although it was).

This is probably a stupid error on my part in changing the code, but I do not know enough about it to find the error.

Any help would be appreciated, and also thank you to Carbonize for the script. I hope to get it working because these bots are making me crazy!

Thank you,
Kerry

ps...guestbook is here http://www.waldorfvfd.com/advgb/
Avatar
carbonize (Administrator) #2
Member since Jan 2004 · 789 posts · Location: Bristol, UK
Group memberships: Administrators, Members
Show profile · Link to this post
I think you messed up the addentry.php file somehow. Either email it to me or post it in here. There is no risk in posting it.
C a r b o n i z e
Avatar
keybush #3
Member since Feb 2005 · 4 posts · Location: Maryland
Group memberships: Members
Show profile · Link to this post
Subject: thanks in advance...
My addentry.php file:

<?php
include("verify.php");
$include_path = dirname(__FILE__);
include_once $include_path."/admin/config.inc.php";
include_once $include_path."/lib/$DB_CLASS";
include_once $include_path."/lib/image.class.php";
include_once $include_path."/lib/template.class.php";

include_once $include_path."/lib/vars.class.php";
include_once $include_path."/lib/add.class.php";

$gb_post = new addentry($include_path);

if (isset($HTTP_POST_VARS["gb_action"])) {
          if (strtoupper($_POST["keycode"])!=$Vword)
         {
              echo ("The <strong>Image Verication</strong> code you supplied is incorrect.<br />\nPlease enter the 8 characters that appear in the image.");
              echo $gb_post->process();
              die();
         }
        $gb_post->Vrand = $Vrand;
        $gb_post->name = (isset($HTTP_POST_VARS["gb_name"])) ? $HTTP_POST_VARS["gb_name"] : '';
    $gb_post->email = (isset($HTTP_POST_VARS["gb_email"])) ? $HTTP_POST_VARS["gb_email"] : '';
    $gb_post->url = (isset($HTTP_POST_VARS["gb_url"])) ? $HTTP_POST_VARS["gb_url"] : '';
    $gb_post->comment = (isset($HTTP_POST_VARS["gb_comment"])) ? $HTTP_POST_VARS["gb_comment"] : '';
    $gb_post->location = (isset($HTTP_POST_VARS["gb_location"])) ? $HTTP_POST_VARS["gb_location"] : '';
    $gb_post->icq = (isset($HTTP_POST_VARS["gb_icq"])) ? $HTTP_POST_VARS["gb_icq"] : '';
    $gb_post->aim = (isset($HTTP_POST_VARS["gb_aim"])) ? $HTTP_POST_VARS["gb_aim"] : '';
    $gb_post->gender = (isset($HTTP_POST_VARS["gb_gender"])) ? $HTTP_POST_VARS["gb_gender"] : '';
    $gb_post->userfile = (isset($HTTP_POST_FILES["userfile"]["tmp_name"]) && $HTTP_POST_FILES["userfile"]["tmp_name"] != "") ? $HTTP_POST_FILES : '';
    $gb_post->user_img = (isset($HTTP_POST_VARS["gb_user_img"])) ? $HTTP_POST_VARS["gb_user_img"] : '';
    $gb_post->preview = (isset($HTTP_POST_VARS["gb_preview"])) ? 1 : 0;
    $gb_post->private = (isset($HTTP_POST_VARS["gb_private"])) ? 1 : 0;
    echo $gb_post->process($HTTP_POST_VARS["gb_action"]);
} else {
    echo $gb_post->process();
}

?>



Thank you very much, in advance!
Avatar
carbonize (Administrator) #4
Member since Jan 2004 · 789 posts · Location: Bristol, UK
Group memberships: Administrators, Members
Show profile · Link to this post
Strange, nothing wrong in that file. Email me your add.class.php file from the lib follder.
C a r b o n i z e
Avatar
carbonize (Administrator) #5
Member since Jan 2004 · 789 posts · Location: Bristol, UK
Group memberships: Administrators, Members
Show profile · Link to this post
OK located the problem. Did you recently upgrade from 2.2 to 2.3.1? I looked at the form and it is usng input names lie name and email which AGB 2.2 used, but in 2.3.1 it uses gb_name and gb_email etc. So while it is expecting an input called gb_name it is getting one just called name.
C a r b o n i z e
Avatar
keybush #6
Member since Feb 2005 · 4 posts · Location: Maryland
Group memberships: Members
Show profile · Link to this post
I did not upgrade, but assumed I was using 2.3.1 because at the bottom of my guestbook, that is the version listed.

Would it be easier to change the "name" to "gb_name" in all my files or just upgrade? I do not know how to upgrade (I just used whatever version my hosting company had in cpanel)

Thanks, Kerry
Avatar
carbonize (Administrator) #7
Member since Jan 2004 · 789 posts · Location: Bristol, UK
Group memberships: Administrators, Members
Show profile · Link to this post
very weird. You can either
1 - Download 2.3.1 from proxy2 ad upload just the templates.
2 - Edit the form templates to place gb_ in th einput names.
3 - Edit your addentry.php file by removing the gb_ from the start of the inputs in there.So ["gb_name"]  becomes ["name"]
C a r b o n i z e
Avatar
keybush #8
Member since Feb 2005 · 4 posts · Location: Maryland
Group memberships: Members
Show profile · Link to this post
I took your suggestion #3...changed "gb_name" to "name" in addentry.php.

the error i am getting now is that the message is too short or too long.  I am assuming I need to make a similar edit on another php page? (Just don't know which one).

I also tried using your upgrade script, and it said it was successful, but I am still getting the error message about the comment being too short or too long.

Thanks again...I really appreciate your expertise and time!

Kerry
Avatar
carbonize (Administrator) #9
Member since Jan 2004 · 789 posts · Location: Bristol, UK
Group memberships: Administrators, Members
Show profile · Link to this post
you need to remove ALL the gb_ from the addentry.php file.
C a r b o n i z e
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please note the verification code from the picture into the text field next to it.
Smilies: :lmao: ':)' :hug: :-)) :shrug: :-' :lol: x-( :-x :'( :-o :-{} :-! :-? :"> :-(( B-) ;-) #-( :-# O_o TiT :-zZ :-) ZzZ
Special characters:
Go to forum
Unclassified NewsBoard 1.6.3 © 2003-6 by Yves Goergen
Page created in 167.4 ms (91.9 ms) · 80 database queries in 11.4 ms
Current time: 2010-09-10, 14:44:42 (UTC +01:00)