Jump to content
Sign in to follow this  
Druide

NEW: Anti Robot Registration Validation

Recommended Posts

Some things to try:

 

!. In validation_png.php

 

after:

 

$bitmap_font_size = 5;// 1 to 5

 

Add:

 

if (PHP_VERSION >= 4.1) $HTTP_GET_VARS =& $_GET;

 

2. In admin >> images

 

set Image Required to true.

 

3. In validation_png.php

 

replace

 

require_once('includes/configure.php');

with

require_once('includes/application_top.php');

 

I only include the last as it has been reported to work for a few, however in my tests it caues failure.

 

 

Hello Spooks (and Steve!)

after these ideas I finally succeded in let this great contribution works !!!

Now... Spooks, as it is a long time I'm working on this issue...

:blink: How may I know I've installed the last version???

(please be patience with my poor knowledge of mysql !)

 

Thanks a lot!

Share this post


Link to post
Share on other sites

Since version 3 validation_check.php & validation.php are added to includes/modules, these did not exist in previous versions.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

I used oscommerce-2.2ms2-FR-060817-2010.zip with easyphp 1.8 (PHP 4.3.10 ; MYSQL : 4.1.9) on Win XP in localhost

 

I used this contrib :

 

http://www.oscommerce.com/community/contributions,4029/

 

I downloaded xXDesertRoseXx :

 

Super Contact us enhancement v1.5 Anti Robot Registration 2.6 (Install Instructions)

Super Contact us enhancement v1.5 Anti Robot Registration 2.6

 

I haven't got and don't see the number of anti-robots. it doesn't display numbers and caracters !

 

I tried Anti Robot Registration Validation : http://www.oscommerce.com/community/contributions,1237

 

I tried with rc2a and easyphp 3.1 on Win XP in localhost

 

I only tried to drop-in all files in catalog folder to my fresh catalog in the host & run the SQL file like installation A ;

 

So I don't what can i do ? :blush:

 

now the error message is :

 

missing SID

 

1249572637fqesj9d.png

 

Config Admin anti-robots : Nothing change

 

1249500969j2m38ix.png

 

Christophe


PHP 4.3.10 ; MYSQL : 4.1.9 ;

Share this post


Link to post
Share on other sites

As is detailed in this thread, this rarely work on windows servers/pcs u need to test on a apache server, please read through the recent posts on fixing display issues with some servers

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hi there, I have downloaded the latest Anti-robot contribution (v3.1 posted on 18 Aug 2009) and installed it on my osCommerce installation running under Windows Vista and Apache 2.2.13 / PHP 5.2.10 / MySQL 5.1.38.

 

By default I had the "missing SID problem" and after fixing that, I had a black image. I also fixed the black image, following the instructions on this topic and now I find that even though in my Administrator I have the following options:

 

-Activate for New Users

-Activate for Editing User Account

-Activate for Changing password

-Activate for Contact Us

-Activate for Link Submission

-Activate for Password forgotten

 

and all these are set to true, I can only see the Anti Robot box for the Contact Us page, for the new Users page and for the Password forgotten page. I cannot see the Anti Robot when I edit a user account and when I change the password. I checked the ZIP file provided on contributions and it seems that account_edit.php and account_password.php are missing from this file. Can you provide these files for the latest version (v3.1)?

 

Also: How can I test the Link Submission page (I mean, where should I go in OsCommerce to verify that it works ok)?

 

Sorry for the trivial questions --> I am a newbie!

 

EDIT: Something I forgot to mention... in my Apache error.log file I get the following:

 

[Tue Sep 15 22:22:28 2009] [error] [client 192.168.1.8] PHP Notice: Undefined variable: rangeList in C:\\Apache2.2\\htdocs\\catalog\\includes\\functions\\account_validation.php on line 47, referer: http://ornella/catalog/contact_us.php?osCs...bn0bnu0ggh27184

[Tue Sep 15 22:22:28 2009] [error] [client 192.168.1.8] PHP Notice: Undefined offset: 17 in C:\\Apache2.2\\htdocs\\catalog\\includes\\functions\\account_validation.php on line 49, referer: http://ornella/catalog/contact_us.php?osCs...bn0bnu0ggh27184

 

Can you help?

Edited by gsova

Share this post


Link to post
Share on other sites

I do not use this for account_edit.php and account_password.php (why annoy your customers, they logged in already) but instructions are included for those, follow that if u want it for them.

 

Link Submission page is from links manager II, but I prefer Reciprocal Links http://addons.oscommerce.com/info/6099

 

See post in this thread to add validation to any page.

 

Your Notices (not errors) are no doubt due to your versions, they are un-immportant (just part of the randomizer) just ignore.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Thanks for the info spooks. One more thing: I have the same problem as this guy here...

 

the button "Alternate View" is like locked...

Doesn't work (I mean as a button).

 

I did a search on the topic but couldn't find a resolution for this issue. Has it been resolved?

 

Once again, thanks for your support.

Share this post


Link to post
Share on other sites
Broken Image (red X of death)

 

Thought I installed everything ok.... But getting black box with red X in it.

 

you can view at: http://intorocks.com/shop/create_account.php

 

any ideas?

 

Thanks!

 

Have read all 38 pages of this thread. Here is some more info:

 

Triple checked all install files and mods to existing files

font is uploaded to correct location and in binary

added the php mod as well as the require once mod

Images req'd is set to true

Force cookies is false

GD is exact as other have posted

I do not lose session while browsing

On Unix server - with php5

tried turning off tt font and filters

 

Anything else I could try???

 

Warm Regards, spooks!

Edited by IntoRocks

Share this post


Link to post
Share on other sites

 

Sorry, missed this thread had dropped off my list!

 

Not sure where your issue would be, I would look at the gd library first, but I see you've gone for the external option now. :)


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hi Sam,

 

I have installed v1.3 (though not the latest update), I have tested it and it works fine, but I noticed some warnings in error.log that happened a few times, what do they mean?

 

[24-Aug-2009 10:40:34] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/username/public_html/validation_png.php on line 95

[24-Aug-2009 10:40:34] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/username/public_html/validation_png.php on line 96

[24-Aug-2009 10:40:34] PHP Warning: imagesx(): supplied argument is not a valid Image resource in /home/username/public_html/includes/functions/account_validation.php on line 147

[24-Aug-2009 10:40:34] PHP Warning: imagesy(): supplied argument is not a valid Image resource in /home/username/public_html/includes/functions/account_validation.php on line 148

[24-Aug-2009 10:40:34] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/username/public_html/includes/functions/account_validation.php on line 152

[24-Aug-2009 10:40:34] PHP Warning: imagecopyresized(): supplied argument is not a valid Image resource in /home/username/public_html/validation_png.php on line 114

[24-Aug-2009 10:40:34] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/validation_png.php:94) in /home/username/public_html/validation_png.php on line 131

[24-Aug-2009 10:40:34] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/validation_png.php:94) in /home/username/public_html/validation_png.php on line 132

[24-Aug-2009 10:40:34] PHP Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/username/public_html/validation_png.php on line 134


~ Don't mistake my kindness for weakness ~

Share this post


Link to post
Share on other sites

Hi Sam,

 

I have installed v1.3 (though not the latest update), I have tested it and it works fine, but I noticed some warnings in error.log that happened a few times, what do they mean?

 

 

 

 

It implies occational errors generating the image, perhaps an sid issue?


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hi

 

I have been using this anti robot registration and it work like a charm until lately where the verification image cannot be shown out of sudden and i have no clue what have made this.

 

I have check the relevant edited php script and it is all still there, i have check the following source html file and it still shown the following:

 

<img src="validation_png.php?rsid=bcb1b6c753fad7d1ba6792bf70686343&csh=04ad9d755bb5d7" alt="" border="0"> <br> <input name="antirobotreg" type="">  <small><font color="#ff0000">required</font></small></span>

 

 

Can i have some clue why the image out of sudden gone missing??

 

Your help is very much appreciated.

 

Thank you

Share this post


Link to post
Share on other sites

 

 

Could you check with you host to see if there have been any changes on the server, ie php/sql upgrades, alterations to gd library, etc

 

 

Also what version of osC r u using?


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

It implies occational errors generating the image, perhaps an sid issue?

 

ok, thanks for looking Sam.


~ Don't mistake my kindness for weakness ~

Share this post


Link to post
Share on other sites

Could you check with you host to see if there have been any changes on the server, ie php/sql upgrades, alterations to gd library, etc

 

 

Also what version of osC r u using?

Thanks for the reply.

 

I have shoot an email to blue host, hopefully they will reply asap. BTW, i am using 2.2 RC2.a version.

Share this post


Link to post
Share on other sites

Hi all

 

I have just install Anti Robot Registration Validation 3.1 and it works great until i tested it. The issue is at the create_account.php. For example if a customer forgets to input a require field, the validation code doesn't refresh itself but instead it shows Validated, thankyou where else other error messages appear above. I have attached some screenshots below. Btw I'm using oscommerce v2.2rc2a. Any help would be appreciated. Thanks.

 

screenshot1.gif

 

screenshot2.gif

Share this post


Link to post
Share on other sites

Validation Validated!!

 

 

Thats an intentional feature!! ohmy.gif

 

The purpose of the validation is to check its a real person, if they have given correct chars once, why annoy them by making them repeat that just because they have made errors elsewhere.

 

If you wish to do it your way, you should have a note added saying don't bother with validation till we check all your other answers!! smile.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hello,

 

I am trying to add this feature to the ask_a_question.php page that is pulled in through the products_tabs contribution. I was trying to follow the instructions found here: http://forums.oscommerce.com/topic/44205-new-anti-robot-registration-validation/page__view__findpost__p__1020013

 

But I am not seeing the box to enter the validation code - I'm not even finding it in my source code. I have even gone directly to an "ask_a_question.php?products_id=966" page to see if it was the iframe causing problems, and I still don't see the validation box :(

 

Has anyone gotten this feature working on the ask_a_question.php tab?

 

I tried moving the final instructions of code in the above referenced link to just before the "not needed for iframe" code, figuring that code doesn't show up in the tab so I would need it in a different place, but I still don't have it working.

 

This is my most recent attempt at adding this to ask_a_question.php

 

<?php
/*
 $Id: ask_a_question.php,v 1.42 2003/06/11 17:35:01 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/


 require('includes/application_top.php');
 // BOF Anti Robot Validation v2.4
 if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {
       require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_VALIDATION);
       include_once('includes/functions/' . FILENAME_ACCOUNT_VALIDATION);
 }
// EOF Anti Robot Registration v2.4
   if (!tep_session_is_registered('customer_id') && (ALLOW_GUEST_TO_TELL_A_FRIEND == 'false')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 $valid_product = false;
 if (isset($HTTP_GET_VARS['products_id'])) {
   $product_info_query = tep_db_query("select pd.products_name, p.products_model,  p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($product_info_query)) {
     $valid_product = true;

     $product_info = tep_db_fetch_array($product_info_query);
   }
 }

 if ($valid_product == false) {
   tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ASK_QUESTION);

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
 // BOF Anti Robot Registration v2.4
       if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {
       $antirobotreg = tep_db_prepare_input($HTTP_POST_VARS['antirobotreg']);
       }
// EOF Anti Robot Registration v2.4
   $error = false;

   $to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
   $to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
   $from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
   $from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
   $message = tep_db_prepare_input($HTTP_POST_VARS['message']);

   if (empty($from_name)) {
     $error = true;
// BOF Anti Robotic Registration v2.4
       if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {
         $sql = "SELECT * FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "' LIMIT 1";
         if( !$result = tep_db_query($sql) ) {
               $error = true;
               $entry_antirobotreg_error = true;
               $text_antirobotreg_error = ERROR_VALIDATION_1;
         } else {
               $entry_antirobotreg_error = false;
               $anti_robot_row = tep_db_fetch_array($result);
               if (( strtoupper($HTTP_POST_VARS['antirobotreg']) != $anti_robot_row['reg_key'] ) || ($anti_robot_row['reg_key'] == '') || (strlen($antirobotreg) != ENTRY_VALIDATION_LENGTH)) {
                 $error = true;
                 $entry_antirobotreg_error = true;
                 $text_antirobotreg_error = ERROR_VALIDATION_2;
               } else {
                 $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "'";
                 if( !$result = tep_db_query($sql) ) {
                       $error = true;
                       $entry_antirobotreg_error = true;
                       $text_antirobotreg_error = ERROR_VALIDATION_3;
                 } else {
                       $sql = "OPTIMIZE TABLE " . TABLE_ANTI_ROBOT_REGISTRATION . "";
                       if( !$result = tep_db_query($sql) ) {
                         $error = true;
                         $entry_antirobotreg_error = true;
                         $text_antirobotreg_error = ERROR_VALIDATION_4;
                       } else {
                         $entry_antirobotreg_error = false;
                       }
                 }
               }
         }
         if ($entry_antirobotreg_error == true) $messageStack->add('submit_link', $text_antirobotreg_error);
       }
// EOF Anti Robotic Registration v2.4
     $messageStack->add('friend', ERROR_FROM_NAME);
   }

   if (!tep_validate_email($from_email_address)) {
     $error = true;

     $messageStack->add('friend', ERROR_FROM_ADDRESS);
   }

   if (empty($to_name)) {
     $error = true;

     $messageStack->add('friend', ERROR_TO_NAME);
   }

   if (!tep_validate_email($to_email_address)) {
     $error = true;

     $messageStack->add('friend', ERROR_TO_ADDRESS);
   }

   if ($error == false) {
     $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
     $email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], $product_info['products_model'], STORE_NAME) . "\n\n";

     if (tep_not_null($message)) {
       $email_body .= $message . "\n\n";
     }

     $email_body .= sprintf(TEXT_EMAIL_LINK, tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])) . "\n\n" .
                    sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");

     tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address);

     $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');

     tep_redirect(tep_href_link(FILENAME_ASK_QUESTION2, 'action=success'));
   }
 } elseif (tep_session_is_registered('customer_id')) {
   $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
   $account = tep_db_fetch_array($account_query);

   $from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
   $from_email_address = $account['customers_email_address'];
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ASK_QUESTION, 'products_id=' . $HTTP_GET_VARS['products_id']));

?>
<!-- // BOF Anti Robot Registration v2.4-->
<?php
       if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'links_submit') &&  ACCOUNT_CREATE_VALIDATION == 'true') {
?>
         <tr>
               <td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td>
         </tr>
         <tr>
               <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
                 <tr class="infoBoxContents">
                       <td><table border="0" cellspacing="2" cellpadding="2">
                         <tr>
<?php
         if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'links_submit') &&  ACCOUNT_CREATE_VALIDATION == 'true') {
               if ($is_read_only == false || (strstr($PHP_SELF,'links_submit')) ) {
                 $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . tep_session_id() . "'";
                 if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); }
                       $reg_key = gen_reg_key();
                       $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" . time() . "')";
                       if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); }
?>
                               <tr>
                                 <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
                                       <tr>
                                         <td class="main"><table border="0" cellspacing="0" cellpadding="2">
                                               <tr>
                                                 <td class="main" width="100%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td>
                                               </tr>
                                               <tr>
                                                 <td class="main" width="100%">
<?php
                         $check_anti_robotreg_query = tep_db_query("select session_id, reg_key, timestamp from anti_robotreg where session_id = '" . tep_session_id() . "'");
                         $new_guery_anti_robotreg = tep_db_fetch_array($check_anti_robotreg_query);

                         $validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '&' . time() . '.png');
                         if ($entry_antirobotreg_error == true) {
?>
<span>
<?php
                               echo $validation_images . ' <br> ';
                               echo tep_draw_input_field('antirobotreg') . ' <br><b><font color="red">' . ERROR_VALIDATION . '<br>' . $text_antirobotreg_error . '</b></font>';
                         } else {
?>
<span>
<?php     
                               echo $validation_images . ' <br> ';
                               echo tep_draw_input_field('antirobotreg', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT;
                         }
                       }
                 }
?>
</span>
                                                 </td>
                                               </tr>
                                         </table></td>
                                       </tr>
                                 </table></td>
                               </tr>
                         </tr>
                       </table></td>
                 </tr>
               </table></td>
         </tr>
       <tr>
 <td>
<?php
                 echo tep_draw_separator('pixel_trans.gif', '100%', '10');
               }
?>
               </td>
         </tr>

<!-- // EOF Anti Robot Registration v2.4-->
<!-- not needed for Iframe 
</head>
<body>
//-->
<!-- body_text //-->
<?php echo tep_draw_form('email_friend', tep_href_link(FILENAME_ASK_QUESTION, 'action=process&products_id=' . $HTTP_GET_VARS['products_id'])); ?>
   <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td>
       <table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="smallText"><br><font color="#0501b5"><b><i><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></i></b></font></td>
           <td class="" align="center"></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 if ($messageStack->size('friend') > 0) {
?>
     <tr>
       <td><?php echo $messageStack->output('friend'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><p><font color="#410000"><strong><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></strong></font></p></td>
               <td class="inputRequirement" align="right"><p><font color="#990000"><?php echo FORM_REQUIRED_INFORMATION; ?></font></p></td>
             </tr>
           </table></td>
         </tr>
         <tr>
           <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
             <tr class="infoBoxContents">
               <td><table border="0" cellspacing="0" cellpadding="2">
                 <tr>
                   <td class="main"><p><font color="#990000">*</font><font color="#410000"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></font></p></td>
                   <td class="main"><p><font color="#410000"><?php echo tep_draw_input_field('from_name'); ?></font></p></td>
                 </tr>
                 <tr>
                   <td class="main"><p><font color="#990000">*</font><font color="#410000"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></font></p></td>
                   <td class="main"><p><font color="#410000"><?php echo tep_draw_input_field('from_email_address'); ?></font></p></td>
                 </tr>
               </table></td>
             </tr>
           </table></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_hidden_field('to_email_address', STORE_OWNER_EMAIL_ADDRESS) . ' <span class="inputRequirement">' . '</span>'; ?><?php echo tep_draw_hidden_field('to_name', STORE_OWNER) . ' <span class="inputRequirement">' . '</span>'; ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td class="main"><p><font color="#990000">*</font><font color="#410000"><strong><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></strong></font></p></td>
         </tr>
         <tr>
           <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
             <tr class="infoBoxContents">
               <td><p><font color="#410000"><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></font></p></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
       <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td></td>
               <td align="right"><?php echo tep_image_submit('button_submit.gif', IMAGE_BUTTON_CONTINUE); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></form>
<!-- body_text_eof //-->
<!-- not needed for Iframe
</body>
</html>
//-->

 

PS - this contribution is working perfectly on my Contact Us, Account Creation, Account Validation, etc... pages. So I know the admin settings are turned on and they shouldn't be the cause if the box not showing up, unless this script is calling for a setting other than what I have.

 

This is what my settings look like right now:

 

Anti Robot Reg

Title Value

Activate the Anti Robot Registration? true

Activate for New Users? true

Activate for Editing of User Account? true

Activate for Changing Passwords? true

Activate for Contact us? true

Length of Validation Code. 5

Width of validation image 100

Height of validation image 50

Horizontal spacing between code characters 10

Vertical margin for validation image 10

Use TrueType fonts? false

TrueType font used ARIAL

Truetype font size 20

Background color 0xFFFFFF

Text color 0x000000

Apply noise filter? false

Apply scatter filter? false

Apply interlace filter? false

Apply grayscale filter? false


~Tracy
 

Share this post


Link to post
Share on other sites

You have added the checking code within name check, so check will only happen if there is a name problem, move that bit.

 

You have placed code for the body part of the page b4 the head, it must be placed within the body, remember you must always follow basic html rules first. wink.gif

 

 


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Thanks Spooks :) I see what you mean by the code being within the name check - I moved that and I put the other code back into the HTML part of the page (it was a Friday - LOL I was thinking the "not needed for iframe" bit was the whole thing rather than just the beginning and ending body tags - LOL :rolleyes: )

 

Anyway - I still am not having any luck at getting it to show up. I'm not sure if I still have the check somehwere it shouldn't be? I've tried it before and after the if blahblahblah $error=true statements. I think it's pulled it out of the other checks so it would be its own thing - what do you think?

 

Any other thoughts as to why it would not show up?

 

<?php
/*
 $Id: ask_a_question.php,v 1.42 2003/06/11 17:35:01 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/


 require('includes/application_top.php');
 // BOF Anti Robot Validation v2.4
 if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {
       require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_VALIDATION);
       include_once('includes/functions/' . FILENAME_ACCOUNT_VALIDATION);
 }
// EOF Anti Robot Registration v2.4
   if (!tep_session_is_registered('customer_id') && (ALLOW_GUEST_TO_TELL_A_FRIEND == 'false')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 $valid_product = false;
 if (isset($HTTP_GET_VARS['products_id'])) {
   $product_info_query = tep_db_query("select pd.products_name, p.products_model,  p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($product_info_query)) {
     $valid_product = true;

     $product_info = tep_db_fetch_array($product_info_query);
   }
 }

 if ($valid_product == false) {
   tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ASK_QUESTION);

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
 // BOF Anti Robot Registration v2.4
       if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {
       $antirobotreg = tep_db_prepare_input($HTTP_POST_VARS['antirobotreg']);
       }
// EOF Anti Robot Registration v2.4
   $error = false;

   $to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
   $to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
   $from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
   $from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
   $message = tep_db_prepare_input($HTTP_POST_VARS['message']);

// BOF Anti Robotic Registration v2.4
       if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {
         $sql = "SELECT * FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "' LIMIT 1";
         if( !$result = tep_db_query($sql) ) {
               $error = true;
               $entry_antirobotreg_error = true;
               $text_antirobotreg_error = ERROR_VALIDATION_1;
         } else {
               $entry_antirobotreg_error = false;
               $anti_robot_row = tep_db_fetch_array($result);
               if (( strtoupper($HTTP_POST_VARS['antirobotreg']) != $anti_robot_row['reg_key'] ) || ($anti_robot_row['reg_key'] == '') || (strlen($antirobotreg) != ENTRY_VALIDATION_LENGTH)) {
                 $error = true;
                 $entry_antirobotreg_error = true;
                 $text_antirobotreg_error = ERROR_VALIDATION_2;
               } else {
                 $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "'";
                 if( !$result = tep_db_query($sql) ) {
                       $error = true;
                       $entry_antirobotreg_error = true;
                       $text_antirobotreg_error = ERROR_VALIDATION_3;
                 } else {
                       $sql = "OPTIMIZE TABLE " . TABLE_ANTI_ROBOT_REGISTRATION . "";
                       if( !$result = tep_db_query($sql) ) {
                         $error = true;
                         $entry_antirobotreg_error = true;
                         $text_antirobotreg_error = ERROR_VALIDATION_4;
                       } else {
                         $entry_antirobotreg_error = false;
                       }
                 }
               }
         }
         if ($entry_antirobotreg_error == true) $messageStack->add('submit_link', $text_antirobotreg_error);
       }
// EOF Anti Robotic Registration v2.4


   if (empty($from_name)) {
     $error = true;

     $messageStack->add('friend', ERROR_FROM_NAME);
   }

   if (!tep_validate_email($from_email_address)) {
     $error = true;

     $messageStack->add('friend', ERROR_FROM_ADDRESS);
   }

   if (empty($to_name)) {
     $error = true;

     $messageStack->add('friend', ERROR_TO_NAME);
   }

   if (!tep_validate_email($to_email_address)) {
     $error = true;

     $messageStack->add('friend', ERROR_TO_ADDRESS);
   }	

   if ($error == false) {
     $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
     $email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], $product_info['products_model'], STORE_NAME) . "\n\n";

     if (tep_not_null($message)) {
       $email_body .= $message . "\n\n";
     }

     $email_body .= sprintf(TEXT_EMAIL_LINK, tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])) . "\n\n" .
                    sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");

     tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address);

     $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');

     tep_redirect(tep_href_link(FILENAME_ASK_QUESTION2, 'action=success'));
   }
 } elseif (tep_session_is_registered('customer_id')) {
   $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
   $account = tep_db_fetch_array($account_query);

   $from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
   $from_email_address = $account['customers_email_address'];
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ASK_QUESTION, 'products_id=' . $HTTP_GET_VARS['products_id']));
?>  

<!-- not needed for Iframe 
</head>
<body>
//-->
<!-- body_text //-->
<?php echo tep_draw_form('email_friend', tep_href_link(FILENAME_ASK_QUESTION, 'action=process&products_id=' . $HTTP_GET_VARS['products_id'])); ?>
   <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td>
       <table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="smallText"><br><font color="#0501b5"><b><i><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></i></b></font></td>
           <td class="" align="center"></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 if ($messageStack->size('friend') > 0) {
?>
     <tr>
       <td><?php echo $messageStack->output('friend'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><p><font color="#410000"><strong><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></strong></font></p></td>
               <td class="inputRequirement" align="right"><p><font color="#990000"><?php echo FORM_REQUIRED_INFORMATION; ?></font></p></td>
             </tr>
           </table></td>
         </tr>
         <tr>
           <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
             <tr class="infoBoxContents">
               <td><table border="0" cellspacing="0" cellpadding="2">
                 <tr>
                   <td class="main"><p><font color="#990000">*</font><font color="#410000"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></font></p></td>
                   <td class="main"><p><font color="#410000"><?php echo tep_draw_input_field('from_name'); ?></font></p></td>
                 </tr>
                 <tr>
                   <td class="main"><p><font color="#990000">*</font><font color="#410000"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></font></p></td>
                   <td class="main"><p><font color="#410000"><?php echo tep_draw_input_field('from_email_address'); ?></font></p></td>
                 </tr>
               </table></td>
             </tr>
           </table></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_hidden_field('to_email_address', STORE_OWNER_EMAIL_ADDRESS) . ' <span class="inputRequirement">' . '</span>'; ?><?php echo tep_draw_hidden_field('to_name', STORE_OWNER) . ' <span class="inputRequirement">' . '</span>'; ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td class="main"><p><font color="#990000">*</font><font color="#410000"><strong><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></strong></font></p></td>
         </tr>
         <tr>
           <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
             <tr class="infoBoxContents">
               <td><p><font color="#410000"><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></font></p></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
       <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
<!-- // BOF Anti Robot Registration v2.4-->
<?php        
if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'links_submit') &&  ACCOUNT_CREATE_VALIDATION == 'true') {
?>          

   	<td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td>          
   </tr>          
   <tr>                
   	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">                <tr class="infoBoxContents">                        
       			<td><table border="0" cellspacing="2" cellpadding="2">                          <tr>
						<?php          
							if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'links_submit') &&  ACCOUNT_CREATE_VALIDATION == 'true') {                
							if ($is_read_only == false || (strstr($PHP_SELF,'links_submit')) ) {                  
							$sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . tep_session_id() . "'";                  				if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); }                        
							$reg_key = gen_reg_key();                        
							$sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" . time() . "')";                        
							if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); }?>                                <tr>                                  <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">                                        
                               <tr>                                          
                               	<td class="main"><table border="0" cellspacing="0" cellpadding="2">                                                
                                   	<tr>                                                  			
                                       	<td class="main" width="100%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td>                                          
                                        </tr>                                                
                                        <tr>                                         
                                           <td class="main" width="100%"><?php                          $check_anti_robotreg_query = tep_db_query("select session_id, reg_key, timestamp from anti_robotreg where session_id = '" . tep_session_id() . "'");                          $new_guery_anti_robotreg = tep_db_fetch_array($check_anti_robotreg_query);                          $validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '&' . time() . '.png');                          if ($entry_antirobotreg_error == true) {?><span><?php                                echo $validation_images . ' <br> ';                                echo tep_draw_input_field('antirobotreg') . ' <br><b><font color="red">' . ERROR_VALIDATION . '<br>' . $text_antirobotreg_error . '</b></font>';                          } else {?><span><?php                                     echo $validation_images . ' <br> ';                                echo tep_draw_input_field('antirobotreg', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT;                          }                        }                  }?></span>                                              </td>                                           </tr>
                                     </table>
                                  </td>
                               </tr>
                          </table>
                        </td>
                    </tr>
                 </table>
               </td>
            </tr>                
          </table>
        </td>
      </tr>
      <tr>  
        <td><?php                  
	 			echo tep_draw_separator('pixel_trans.gif', '100%', '10');
              }?>                
         </td>          

<!-- // EOF Anti Robot Registration v2.4-->      

           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td></td>
               <td align="right"><?php echo tep_image_submit('button_submit.gif', IMAGE_BUTTON_CONTINUE); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></form>
<!-- body_text_eof //-->
<!-- not needed for Iframe
</body>
</html>
//-->

 

You have added the checking code within name check, so check will only happen if there is a name problem, move that bit.

 

You have placed code for the body part of the page b4 the head, it must be placed within the body, remember you must always follow basic html rules first. wink.gif


~Tracy
 

Share this post


Link to post
Share on other sites

LOL - now that I finally had a few minutes to think while looking at this without being interrupted, I realized I simply had to change the reference to $PHP_SELF in order to get it working :blush:

 

Thanks for your help Spooks!! :D

 

Thanks Spooks :) I see what you mean by the code being within the name check - I moved that and I put the other code back into the HTML part of the page (it was a Friday - LOL I was thinking the "not needed for iframe" bit was the whole thing rather than just the beginning and ending body tags - LOL :rolleyes: )

 

Anyway - I still am not having any luck at getting it to show up. I'm not sure if I still have the check somehwere it shouldn't be? I've tried it before and after the if blahblahblah $error=true statements. I think it's pulled it out of the other checks so it would be its own thing - what do you think?

 

Any other thoughts as to why it would not show up?

 


~Tracy
 

Share this post


Link to post
Share on other sites

Thanks for contribution! I use v3.1 now

 

Meanwhile still have trick with password_forgotten.php only. Unfortunately it doent show validate image even with Change Password activated in Admin.

I cheched the page source and it says

<!-- // BOF Anti Robot Registration v3.0-->

<!-- // EOF Anti Robot Registration v3.0-->

Looks like this condition doesnt play

?php
   if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'password_forgotten') &&  ACCOUNT_PASSWORD_FORGOTTEN_VALIDATION == 'true') include(DIR_WS_MODULES . FILENAME_DISPLAY_VALIDATION); ?>

 

Please any advice!

 

Also, noted that while clicking reload button it plays with wide of validate image. That expands some borders of the tables and a bit brake style of my site.

Share this post


Link to post
Share on other sites

well, this contribution is really very nice but this works only if -XBM Support- is enable in server.

 

to check this, you could run this script in the server:

 

<?php

echo '<div style="margin: 10px;">';

echo '<p style="color: #444444; font-size: 130%;">GD is ';

if (function_exists("gd_info")) {

echo '<span style="color: #00AA00; font-weight: bold;">supported</span> by your server!</p>';

$gd = gd_info();

foreach ($gd as $k => $v) {

echo '<div style="width: 340px; border-bottom: 1px solid #DDDDDD; padding: 2px;">';

echo '<span style="float: left;width: 300px;">' . $k . '</span> ';

if ($v)

echo '<span style="color: #00AA00; font-weight: bold;">Yes</span>';

else

echo '<span style="color: #EE0000; font-weight: bold;">No</span>';

echo '<div style="clear:both;"><!-- --></div></div>';

}

} else {

echo '<span style="color: #EE0000; font-weight: bold;">not supported</span> by your server!</p>';

}

echo '</div>';

?>

 

I would like to ask if is possible to run this contribution with an alternative way using images instead fonts.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×