Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW: Anti Robot Registration Validation


Druide

Recommended Posts

By the way, i took the direct link from my javascript source, "www.site.net/validation_png.php?rsid=xxx&csh=xx" and tried to manually get the picture by placing the link in the browser. I got the error message: The picture “www.site.net/validation_png.php?rsid=xxx&csh=xx” contains errors, and can therefor not be shown. (In norwegian though, so i had to translate, im not quite sure what the original error is)

 

Regards Morten

Link to comment
Share on other sites

--------------------

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.

Link to comment
Share on other sites

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.

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.

Link to comment
Share on other sites

I`m afraid I`ve run out of suggestions, it would appear to be a failure of your server gd library.

 

If you have in admin >> images

 

set Image Required to true. its also strange you still get the red x, as normally u get iether blank or an image!!

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.

Link to comment
Share on other sites

Hm, i guess the red x just says that its required? I just changed it from "required" to the red "x".

 

But, yes, its very strange indeed.

 

This was bad news. But thanks for your help anyways.. Guess i just have to try all kinds of different things.

 

The Image Required option is already set to True.

 

But one thing. I have installed the Image Magic module. Can that affect the output?

 

Regards Morten

Link to comment
Share on other sites

You could tgry setting up a test version of osC (ie a vanilla rc2a) in a new directory on your server, install this on that, if that works u know its something u have added, if it don't then its a server 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.

Link to comment
Share on other sites

a vanilla rc2a means osC rc2a with no mods or contribs whatsoever, just as it comes.

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.

Link to comment
Share on other sites

Now i got some new information for you.

 

I have made one test.php file with the following information:

 

<?php

 require('includes/application_top.php');

// BOF Anti Robot Registration v3.0
 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 v3.0

// BOF Anti Robot Registration v3.0
if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {
$antirobotreg = tep_db_prepare_input($HTTP_POST_VARS['antirobotreg']);
}
// EOF Anti Robot Registration v3.0
echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); 

if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'test') &&  ACCOUNT_CREATE_VALIDATION == 'true') 
include(DIR_WS_MODULES . FILENAME_DISPLAY_VALIDATION); 



?>
</form>

 

 

 

This works perfecty in my test folder. But not in my main catalog. So i wonder if it has anything to do with some server settings or .htaccess settings (though i've tried to delete everything inside this file, without any luck at all.) I have also tried to use the application_top from the test server in my main catalog. Without success.

 

 

So, does it ring a bell?

 

All help is much appreciated.

 

Regards Morten

Edited by Mortenjan
Link to comment
Share on other sites

Problemo solved!

Got some help from my host.

It was two empty lines in my filenames.php and database_tables.php.

 

I have no clue why that should block the picture. But it sure did.

 

Thanks alot for the beeing one of those who made this contribution spooks!

 

Regards

Morten

Link to comment
Share on other sites

// BOF Anti Robotic Registration v3.1
if (ACCOUNT_VALIDATION == 'true' ) {
 include(DIR_WS_MODULES . FILENAME_CHECK_VALIDATION);
  if ($entry_antirobotreg_error == true) $messageStack->add('contact', $text_antirobotreg_error);
}
// EOF Anti Robotic Registration v3.1

 

 

 

Just something I noticed when I was installing this on my gift card redemption, it should be

 

 

// BOF Anti Robotic Registration v3.1
if (ACCOUNT_VALIDATION == 'true' ) {
 include(DIR_WS_MODULES . FILENAME_CHECK_VALIDATION);
  if ($entry_antirobotreg_error == true) $messageStack->add('contact', $text_antirobotreg_error);
}

   if (!$entry_antirobotreg_error) {
// EOF Anti Robotic Registration v3.1

 

then close the bracket once you run your form processes.

Link to comment
Share on other sites

Hi, how should look file : ask_a_question.php with Anit Robot? Anybody can help me? This is my file, please help me add to him code about Anti Robot. Thanks!

 

<?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');
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')) {
$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;

  $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_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
}
 } 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']));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top">
<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?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="dopasuj_cene"><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?> - (<?php echo $product_info['products_model'] ?>)</td>
		<td class="askQuestion" align="center"><?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></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"><b><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></b></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"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
				<td class="main"><?php echo tep_draw_input_field('from_name',($from_name)?$from_name:''); ?></td>
			  </tr>
			  <tr>
				<td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
<td class="main"><?php echo tep_draw_input_field('from_email_address',($from_email_address)?$from_email_address:''); ?></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"><b><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></b></td>
	  </tr>
	  <tr>
		<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
		  <tr class="infoBoxContents">
			<td><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></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><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
			<td align="right"><?php echo tep_image_submit('button_continue.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></td></form>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by cezar99
Link to comment
Share on other sites

It means the oSsid is missing, caused by incorrect linkling within your site usually see

 

 

 

http://www.oscommerce.com/forums/index.php?sho...c=330479&hl

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.

Link to comment
Share on other sites

  • 2 weeks later...

it does not work under windows, otherwise the only problems are usually related to gd library

 

There are some alterations to try detailed in the thread

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.

Link to comment
Share on other sites

it does not work under windows, otherwise the only problems are usually related to gd library

 

There are some alterations to try detailed in the thread

Hi Sam,

 

GD library seems fine,

 

GD Support enabled

GD Version bundled (2.0.34 compatible)

FreeType Support enabled

FreeType Linkage with freetype

FreeType Version 2.2.1

GIF Read Support enabled

GIF Create Support enabled

JPG Support enabled

PNG Support enabled

WBMP Support enabled

XBM Support enabled

 

gettext

GetText Support enabled

 

although im getting a strange output from validation_png_php.

http://www.hopebuymore.com/cwb/validation_png.php below is output

‰PNG

 

Steve

Edited by steve_s
Link to comment
Share on other sites

have u tried

 

In admin >> images

 

set Image Required to true

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.

Link to comment
Share on other sites

It is most likely a server issue, what I could'nt say, does host have any alternate servers?

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.

Link to comment
Share on other sites

It is most likely a server issue, what I could'nt say, does host have any alternate servers?

I shall find out, i imagine they do or at least hope so :)

 

Thanks

Steve

Edited by steve_s
Link to comment
Share on other sites

  • 2 weeks later...

I want to be able to add this excellent contrib to another page to stop people from leaving a Testimonial without inputting a Validation code is there any way someone can help me to modify the pages so that I can get it to do this.

 

Thank you

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...