Jump to content
Druide

NEW: Anti Robot Registration Validation

Recommended Posts

Hello Alex,

 

unfortunately I do not have a reference point like I it with the new type character insert. I try it am several days: - (my contribution see above. You can help me there. It would be genuinly super nicely

Share this post


Link to post
Share on other sites

Does anyone know how to change the size of the validation code box? Its huge and it messes up my layout. i know its in the contact us php file i just dont know what peice of code i need to change. is it the table code?

 

please help.

 

Thanks

 

Tom

Share this post


Link to post
Share on other sites

I have done the post install testing and I do get an image with the test.

However, the image does not appear on any of the appropriate pages. Most likely it is the issue of the tep_image() function in html_output.php.

 

The html_output.php file has been edited for the following contribs:

Basic design pack

How Did You Hear

 

By change is there anyone that is using 1 or both of these contribs that has been able to get anti-robot contrib to work properly? If so, how?

Share this post


Link to post
Share on other sites
I have done the post install testing and I do get an image with the test.

However, the image does not appear on any of the appropriate pages. Most likely it is the issue of the tep_image() function in html_output.php.

 

The html_output.php file has been edited for the following contribs:

Basic design pack

How Did You Hear

 

By chance is there anyone that is using 1 or both of these contribs that has been able to get anti-robot contrib to work properly? If so, how?

Here is what I did as a test based upon a post by someone else.

 

Here is the original modified file they had:

if (tep_not_null($alt)) {

$image .= ' title=" ' . tep_output_string($alt) . ' "';

}

if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {

if ($image_size = @getimagesize($src)) {

 

They changed it to:

if (tep_not_null($alt)) {

$image .= ' title=" ' . tep_output_string($alt) . ' "';

}

if ( (substr($src,0,24)!='validation_png.php?rsid=') && (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {

if ($image_size = @getimagesize($src)) {

 

I looked on my file where I had the CONFIG-CALCULATE-IMAGE-SIZE and ere is the modified file I have:

if ($image_size = @getimagesize($src)) {

if ((CONFIG_CALCULATE_IMAGE_SIZE == 'true' &&

$src != DIR_WS_IMAGES . 'pixel_black.gif' && $src != DIR_WS_IMAGES . 'pixel_trans.gif' && $src != DIR_WS_IMAGES . 'pixel_silver.gif' )) {

if ( ($width) || ($height) ) {

 

I changed it to:

if ($image_size = @getimagesize($src)) {

if ( (substr($src,0,24)!='validation_png.php?rsid=') && (CONFIG_CALCULATE_IMAGE_SIZE == 'true' &&

$src != DIR_WS_IMAGES . 'pixel_black.gif' && $src != DIR_WS_IMAGES . 'pixel_trans.gif' && $src != DIR_WS_IMAGES . 'pixel_silver.gif' )) {

if ( ($width) || ($height) ) {

This did not break anything, but it also did not make the anti-robot image come up either.

Any suggestions?

Share this post


Link to post
Share on other sites

This question has been answered many times. Please search in this thread for the work around of modified tep_image() function.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
This question has been answered many times. Please search in this thread for the work around of modified tep_image() function.

 

The solution given is:

If you modified the function tep_image(); the png images might not shown. To work around this issue, try to find the original function in oscommerce release packages, and rename the original function name to tep_image_original() and add it back into html_output.php in the folder catalog/includes/functions

 

and in the codes of this update, replace tep_image() to tep_image_original()

I am sorry for not totally understanding this.

 

I go to the odefault html_output.php file. It looks like this.

// The HTML image wrapper function

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

return false;

}

 

I look at me edited html_output.php and it is the same. But I do have other edits in my html_output.php since I am using Basic Design Pack.

 

So, I thought I would still try the suggestion.

 

But I am confused what I need to do according to:

 

and in the codes of this update

What file has the 'codes of this update'? Are you talking about any references to function tep_image or just to tep_image in the contact, create_account, etc. pages of this contrib? Because I can't find any funtion tep_image references in any of the files to this contrib

 

Are you talking about where there is php echo tep_image or just to tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg

or something different?

 

What I am also confused about is if I change the function tep_image to function tep_image_original in html_output.php won't this affect my entire site where there are references to function tep_image?

 

Please help me to understand this more clearly.

 

Or hopefully, somebody is using this contrib and Basic Design Pack and will not what exactly to to.

Share this post


Link to post
Share on other sites
:

:

I go to the odefault html_output.php file. It looks like this.

I look at me edited html_output.php and it is the same. But I do have other edits in my html_output.php since I am using Basic Design Pack.

The genuine tep_image() came with 060817 release is:
  function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
  return false;
}

// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) {
  $image .= ' title=" ' . tep_output_string($alt) . ' "';
}

if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
  if ($image_size = @getimagesize($src)) {
	if (empty($width) && tep_not_null($height)) {
	  $ratio = $height / $image_size[1];
	  $width = intval($image_size[0] * $ratio);
	} elseif (tep_not_null($width) && empty($height)) {
	  $ratio = $width / $image_size[0];
	  $height = intval($image_size[1] * $ratio);
	} elseif (empty($width) && empty($height)) {
	  $width = $image_size[0];
	  $height = $image_size[1];
	}
  } elseif (IMAGE_REQUIRED == 'false') {
	return false;
  }
}

if (tep_not_null($width) && tep_not_null($height)) {
  $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

$image .= '>';

return $image;
 }

The work around suggested to put it back in your modified html_output.php, with a different function name like:

  function tep_image_original($src, $alt = '', $width = '', $height = '', $parameters = '') {

 

:

:

Are you talking about where there is php echo tep_image or just to tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg

or something different?

yes, just to $validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']);

and change to $validation_images = tep_image_original('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']);

 

What I am also confused about is if I change the function tep_image to function tep_image_original in html_output.php won't this affect my entire site where there are references to function tep_image?
Nop, you don't change that modified tep_image() function in your html_output.php. Instead, you add a new function tep_image_original() to it. Got it?

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites

Ok, yes, it is very clear to me what I need to do:

1. Insert in html_ouput.php the original full function tep_image file.

2. Replace tep_image with tep_image_original in the original file

3. Go to contact_us.php file and replace $validation_images = tep_image with $validation_images = tep_image_original

 

It still does give me an image.

 

So for testing purposes, I uploaded the ENTIRE default html_output.php (with no edits) and I uploaded the contrib version of contact_us.php . I still do not get an image.

 

Any other ideas?

Share this post


Link to post
Share on other sites

I should mention that everything else seems to work. On the contact form it does have a place to enter digits. If nothing is entered it does come up with red error message. If I turn off validation the box does disappear.

Share this post


Link to post
Share on other sites

Same here: no matter what I try with tep_image.

 

Here's a work around I found; it's not the best but it works:

 

Replace:

$validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']);

 

with:

$validation_images = '<img src="validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '">';

 

It still beats me why tep_image does not work but it seems to generate nothing when called.

Edited by CleverBuyer

Share this post


Link to post
Share on other sites
Same here: no matter what I try with tep_image.

 

Here's a work around I found; it's not the best but it works:

 

Replace:

$validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']);

 

with:

$validation_images = '<img src="validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '">';

 

It still beats me why tep_image does not work but it seems to generate nothing when called.

hey, nice try. Why didn't think of such easy solution? :thumbsup:


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
Same here: no matter what I try with tep_image.

 

Here's a work around I found; it's not the best but it works:

 

Replace:

$validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']);

 

with:

$validation_images = '<img src="validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '">';

 

It still beats me why tep_image does not work but it seems to generate nothing when called.

I tried this but I still did not get the image.

 

So, I went and did a test by going to:

http://www.yourdomain.com/catalog/validati...ng.php?rsid=the session id you just copied

 

This pulls up the background but does not show any digits.

 

What is strange is that this part was working before.

Share this post


Link to post
Share on other sites
Replace:

$validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']);

 

with:

$validation_images = '<img src="validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '">';

 

 

I tried this but I still did not get the image.

 

So, I went and did a test by going to:

http://www.yourdomain.com/catalog/validati...ng.php?rsid=the session id you just copied

 

This pulls up the background but does not show any digits.

 

What is strange is that this part was working before.

 

Here are the last six sessions in my sessions database.

 

lm7dre9ve6ktrkd0cijcbb2b87 1168274800 language|s:7:"english";languages_id|s:1:"1";select...

rikepihnf8nbse7ihsqohul177 1168275063 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

m138ep8v1hphotj4cmdte791n7 1168271689 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1lsvt1048d00s3t9q43ilnnnj3 1168278394 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1mn2ba0amlqpuv2geh1dg1qu52 1168281194 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

 

When I go to anti-robot database, the session listed is:

rikepihnf8nbse7ihsqohul177

 

When I test this session using:

http://www.yourdomain.com/catalog/validati...bse7ihsqohul177

I do see the background image and numbers.

 

I closed the browser and did another test.

 

Now my dession database has

lm7dre9ve6ktrkd0cijcbb2b87 1168274800 language|s:7:"english";languages_id|s:1:"1";select...

rikepihnf8nbse7ihsqohul177 1168275063 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

m138ep8v1hphotj4cmdte791n7 1168271689 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1lsvt1048d00s3t9q43ilnnnj3 1168278394 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1mn2ba0amlqpuv2geh1dg1qu52 1168281567 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

0uuissjfoi267k4vsahsmiink1 1168281493 cart|O:12:"shoppingCart":4:{s:8:"contents";a:0:{}s...

cltscjro8s641uou6kpqcilrc0

 

antirobot now has

1mn2ba0amlqpuv2geh1dg1qu52

 

SO IT APPEARS TO ME

that the antirobot is not using the last session, it is using 2-3 sessions behind. What would be causing this?

Share this post


Link to post
Share on other sites
Here are the last six sessions in my sessions database.

 

lm7dre9ve6ktrkd0cijcbb2b87 1168274800 language|s:7:"english";languages_id|s:1:"1";select...

rikepihnf8nbse7ihsqohul177 1168275063 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

m138ep8v1hphotj4cmdte791n7 1168271689 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1lsvt1048d00s3t9q43ilnnnj3 1168278394 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1mn2ba0amlqpuv2geh1dg1qu52 1168281194 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

 

When I go to anti-robot database, the session listed is:

rikepihnf8nbse7ihsqohul177

 

When I test this session using:

http://www.yourdomain.com/catalog/validati...bse7ihsqohul177

I do see the background image and numbers.

 

I closed the browser and did another test.

 

Now my dession database has

lm7dre9ve6ktrkd0cijcbb2b87 1168274800 language|s:7:"english";languages_id|s:1:"1";select...

rikepihnf8nbse7ihsqohul177 1168275063 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

m138ep8v1hphotj4cmdte791n7 1168271689 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1lsvt1048d00s3t9q43ilnnnj3 1168278394 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

1mn2ba0amlqpuv2geh1dg1qu52 1168281567 cart|O:12:"shoppingCart":5:{s:8:"contents";a:0:{}s...

0uuissjfoi267k4vsahsmiink1 1168281493 cart|O:12:"shoppingCart":4:{s:8:"contents";a:0:{}s...

cltscjro8s641uou6kpqcilrc0

 

antirobot now has

1mn2ba0amlqpuv2geh1dg1qu52

 

SO IT APPEARS TO ME

that the antirobot is not using the last session, it is using 2-3 sessions behind. What would be causing this?

The sesskey is generated randomly, and not necessarily sorted in phpMyAdmin. Since you can see the png image with validation code, it should work with the simple <img src= tag, unless your validation_png.php is not in the same folder with the file calling it.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites

How about enabling this great feature for the "Tell A Friend" page (which can be very usefull to spammers).

 

I tried it last night by doing more or less the same thing as for the rest of the pages but had no luck.

Will try again tonight....

 

It'd be greate to see this in the next version.

 

Keep up the good work :thumbsup:

Share this post


Link to post
Share on other sites

I was able to get the image to come up properly by making the recent suggested change. But encountered another problem. When using it with the contact_us.php page, it comes up with an error message stating that the e-mail address appears to not be valid-when the e-mail address is valid.

 

I went back to a previous version of the contact_us.php page that does not have the anti-robot and works fine.

 

I notice that the anti-robot script has a check e-mail address feature. How is it determining what is a vaild e-mail address?

It would be nice to have this feature, if it works properly.

 

Otherwise I can just delete this correct?

 

// BOF Anti Robot Registration v2.5

if (!tep_validate_email($email_address)) {

$error = true;

$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

} elseif (!$entry_antirobotreg_error == true) {

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

}

 

// EOF Anti Robotic Registration v2.5

Share this post


Link to post
Share on other sites
I was able to get the image to come up properly by making the recent suggested change. But encountered another problem. When using it with the contact_us.php page, it comes up with an error message stating that the e-mail address appears to not be valid-when the e-mail address is valid.

 

I went back to a previous version of the contact_us.php page that does not have the anti-robot and works fine.

 

I notice that the anti-robot script has a check e-mail address feature. How is it determining what is a vaild e-mail address?

It would be nice to have this feature, if it works properly.

 

Otherwise I can just delete this correct?

 

// BOF Anti Robot Registration v2.5

if (!tep_validate_email($email_address)) {

$error = true;

$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

} elseif (!$entry_antirobotreg_error == true) {

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

}

 

// EOF Anti Robotic Registration v2.5

The tep_valid_email() will check if the email address has invalid characters, is with a correct structure, is with a domain name not an IP, has different domain from your store......, etc.

 

This function is built-in with osCommerce 2.2 MS2 060817 release, not Anti Robotic Registration code.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
The tep_valid_email() will check if the email address has invalid characters, is with a correct structure, is with a domain name not an IP, has different domain from your store......, etc.

 

This function is built-in with osCommerce 2.2 MS2 060817 release, not Anti Robotic Registration code.

I have a contact page that does not have the antirobot script on it. It accepts the e-mail I have (webmaster@aplaceofhope.com). When I use the contact page that has the listed anti-robot then the e-mail address error comes up. So this has to be something with anit-robot.

Share this post


Link to post
Share on other sites
How about enabling this great feature for the "Tell A Friend" page (which can be very usefull to spammers).

 

I tried it last night by doing more or less the same thing as for the rest of the pages but had no luck.

Will try again tonight....

 

It'd be greate to see this in the next version.

 

Keep up the good work :thumbsup:

 

There you go, the feature enabled in the Tell a Friend page. It work with the CONTACT_US variables so when you enable the contact us page, this one gets enabled too. It should be trivial to change this and add the required parameters to the DB.....

 

Here is the whole of my "Tell A friend" page file "tell_a_friend.php" (sorry about the long post but I found no way of attaching a file to the post):

<?php
/*
 $Id: tell_a_friend.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.5
 if (ACCOUNT_VALIDATION == 'true' && CONTACT_US_VALIDATION == 'true') {
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_VALIDATION);
include_once('includes/functions/' . FILENAME_ACCOUNT_VALIDATION);
 }
// EOF Anti Robot Registration v2.5


 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 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_TELL_A_FRIEND);

 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']);

// BOF Anti Robotic Registration v2.5
if (ACCOUNT_VALIDATION == 'true' && CONTACT_US_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('friend', $text_antirobotreg_error);
	$error=true;
  }
}
// EOF Anti Robotic Registration v2.5
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'], 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_TELL_A_FRIEND, '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_TELL_A_FRIEND, '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="pageHeading"><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_tell_a_friend.gif', sprintf(HEADING_TITLE, $product_info['products_name']), HEADING_IMAGE_WIDTH, HEADING_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>
			<td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></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'); ?></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'); ?></td>
			  </tr>
			</table></td>
		  </tr>
		</table></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_DETAILS; ?></b></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_FRIEND_NAME; ?></td>
				<td class="main"><?php echo tep_draw_input_field('to_name') . ' <span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>
			  </tr>
			  <tr>
				<td class="main"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
				<td class="main"><?php echo tep_draw_input_field('to_email_address') . ' <span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>'; ?></td>
			  </tr>
			</table></td>
		  </tr>
		</table></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>
<?php
// BOF Anti Robot Registration v2.5
 if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'tell_a_friend') &&  CONTACT_US_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,'tell_a_friend') && CONTACT_US_VALIDATION == 'true') {
  if ($is_read_only == false || (strstr($PHP_SELF,'tell_a_friend')) ) {
	$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 = '<img src="validation_png.php?rsid=' .  $new_guery_anti_robotreg['session_id'] . '">';
	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>
<?php
	}
// EOF Anti Robot Registration v2.5
?>





  <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></form></td>
<!-- 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'); ?>

 

Enjoy!

Share this post


Link to post
Share on other sites
I have a contact page that does not have the antirobot script on it. It accepts the e-mail I have (webmaster@aplaceofhope.com). When I use the contact page that has the listed anti-robot then the e-mail address error comes up. So this has to be something with anit-robot.

It seems to me that you have done something wrong with the contact_us.php

 

The genuine code came with 060817 release in that block you mentioned is:

	if (tep_validate_email($email_address)) {
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

  tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
} else {
  $error = true;

  $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}

The tep_validate_email() function is in there. Anti Robot code just modified it to check the validation code as well, and an additional error message if the input validation code didn't match. If your contact_us.php didn't have that tep_validate_email() function call, it must has been modified.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
It's very impossible to insert smaller characters ?

thanks

well, the characters were grabbed from phpBB2 code, they were 40x40 px filtered.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites

Where are these lines of code?

 

 

 

I've looked in my html_output.php and my validation files and nowhere do I see the string "$validation" anything.

 

 

 

Did I not upload a new file or change the code somewhere.

 

 

 

The box is there but not the png image to correctly entre with.

 

I know I'm coming in late and I reviewed all the previous posts, but I must be dense since I'm missing something?

 

 

 

Thanks, Steve


Steve in Grayslake, IL

Share this post


Link to post
Share on other sites
I've looked in my html_output.php and my validation files and nowhere do I see the string "$validation" anything.

 

The box is there but not the png image to correctly entre with.

Did you do the post-install test? Did you see the png image shown with validation code?

 

If the png image did show up in test but not in the form, then there is a simple workaround in page 11 of this thread, using html <img src="xxxxxx"> tag in the form instead of the tep_image() function call. Please try a little bit harder to find your answer in this thread.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites
Did you do the post-install test? Did you see the png image shown with validation code?

 

If the png image did show up in test but not in the form, then there is a simple workaround in page 11 of this thread, using html <img src="xxxxxx"> tag in the form instead of the tep_image() function call. Please try a little bit harder to find your answer in this thread.

 

 

 

Yes, I saw this:

 

Replace:

$validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']);

 

with:

$validation_images = '<img src="validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '">';

 

 

but I don't have that line of code in my html_output.php file, the closest I can find is:

 

////

// The HTML image wrapper function

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

return false;

}

 

 

I'm getting the impression that I eiether missed adding something to this file, or the zip download didn't contain any reference or copy of this file. Is that possible?

 

And yes, when I ran the test I did get the image when querying the file directly, just not in the osc program itself.

Edited by bnguru

Steve in Grayslake, IL

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

×