Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW: Anti Robot Registration Validation


Druide

Recommended Posts

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;

}

Those lines need to be modified are not in html_output.php. They are in the forms you want to have this validation code, e.g. create_account.php account_edit.php account_password.php contact_us.php.

 

With the html img tags, you don't need to modify your html_output.php.

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.

Link to comment
Share on other sites

Those lines need to be modified are not in html_output.php. They are in the forms you want to have this validation code, e.g. create_account.php account_edit.php account_password.php contact_us.php.

 

With the html img tags, you don't need to modify your html_output.php.

 

 

 

Thank you -

 

 

 

Forgive my ignorence but I discovered why I was having such a problem (I hate to admit my own stupidity) - My Perl scripting program was searching for the string "$validation" so I thought and it never found that in any php file. Today when I went back into it I discovered I typed "$validatioon" - well duh!

 

 

 

Anyhow, it is now fixed and working beautifully.

 

 

 

Did I see somewhere in this thread that this application can ba applied to the login screen as well for when customers return?

Steve in Ellenton, FL

Link to comment
Share on other sites

I installed the contribution and it went smoothly - the images appear just fine in my New Account and Account Edit pages. Thank you very much!

 

I get an error on my Contact Us page 'unexpected $end on line 310' which I assume means I have unbalanced braces, but I counted them all and checked all the code installation instructions twice, comparing each code snippet with the code pasted into the file.

 

Any suggestions? :(

Link to comment
Share on other sites

I installed the contribution and it appears to be fine but have a problem with the contact us section. I have the Super Contact us enhancement 1.3 installed and running into problems. Here is what it shows in the install instructions

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

}

. Here is what mine shows
if (tep_validate_email($email_address)) {

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

if (CONTACT_US_LIST !=''){

$send_to_array=explode("," ,CONTACT_US_LIST);

preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);

$send_to_email= eregi_replace (">", "", $send_email_array[0]);

$send_to_email= eregi_replace ("<", "", $send_to_email);

 

tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);

}else{

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

}

// EOF Super Contact us enhancement 1.3

} else {

$error = true;

 

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

}

}

 

and this is what it says to replace it with:

// 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

Second section is this, it shows this
<tr>

<td class="main"><?php echo ENTRY_ENQUIRY; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

but mine looks like this -
</select><br />

<?php echo ENTRY_ENQUIRY; ?><BR>

<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>

<br />

</td></tr></table></td>

</tr>

</table>

<br />

<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 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>

<?php

}

?>

<!-- EOF Super Contact us enhancement 1.3 //-->

 

</table></form></td>

<!-- body_text_eof //-->

 

and here is the addition it says to add

<?php

// BOF Anti Robot Registration v2.5

if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'contact_us') && 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,'contact_us') && CONTACT_US_VALIDATION == 'true') {

if ($is_read_only == false || (strstr($PHP_SELF,'contact_us')) ) {

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

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

?>

 

If someone can help me figure this out, it would be greatly appreciated and thanks in advance.

Link to comment
Share on other sites

I installed the contribution and it appears to be fine but have a problem with the contact us section. I have the Super Contact us enhancement 1.3 installed and running into problems. Here is what it shows in the install instructions. Here is what mine shows

 

and this is what it says to replace it with: Second section is this, it shows this but mine looks like this -

 

and here is the addition it says to add

 

If someone can help me figure this out, it would be greatly appreciated and thanks in advance.

Please check this post to see if it helps.

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.

Link to comment
Share on other sites

I just install it onto my current site which had the 'anti_spambot_contact_us' contribution (working).

 

I replaced all the files and removed the previouses MySQL entries for anti_spambot_contact_us.

 

then runned the (english version) sql file in MySQL.

 

and I CAN'T see the graphics/letters.... they do not show up... Please Help!!!

 

I have checked everything an can't figure what's wrong. (spended all night testing with no luck).

 

Maybe I am too tired to see what's going on.... HELP!

Edited by graphicore
Link to comment
Share on other sites

I just install it onto my current site which had the 'anti_spambot_contact_us' contribution (working).

 

I replaced all the files and removed the previouses MySQL entries for anti_spambot_contact_us.

 

then runned the (english version) sql file in MySQL.

 

and I CAN'T see the graphics/letters.... they do not show up... Please Help!!!

 

I have checked everything an can't figure what's wrong. (spended all night testing with no luck).

 

Maybe I am too tired to see what's going on.... HELP!

Did you do the post install test?

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.

Link to comment
Share on other sites

I am lost....

I rechecked everything and seems Ok... But I still can't see the PNG letters.

 

I am trying very hard not to quit on this contribution. (since I need it)

 

Could it be something on the database?????

Edited by graphicore
Link to comment
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.

 

Sorry for all the previouses post (I couldn't sleep all night finishing my site to launch... then decided to install this contrib).

 

This fix did the job.... Thanks to CleverBuyer for it.

Link to comment
Share on other sites

Hi. I'm Jenny. I'm new to oscommerce. :(

 

I wonder if anyone can help me out with is problem.

 

While running the sql [ Anti Robot Registration 2.5_english.sql ] on the sql server. phpadmin reply :

 

Error

SQL query:

 

INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible )

VALUES (

 

'736', 'Anti Robot Reg', 'Anti Robot Registration', 300, 1

);

 

 

 

MySQL said:

 

#1046 - No Database Selected

 

 

 

The installation is over a new oscommerce installation. Did I miss something?.

 

Thanks.

Link to comment
Share on other sites

MySQL said:

 

#1046 - No Database Selected

Please select a database you setup for osCommerce prior to run the sql script.

Edited by AlexStudio

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.

Link to comment
Share on other sites

Did I miss something on shared hosting?

 

When I load any page everything but the image loads. If I copy the address of the image into a new browser window, it just has my shared IP address. Can I change something to use the full host name or cant I use it on a shared host?

 

Thanks Shawn

Link to comment
Share on other sites

Did I miss something on shared hosting?

 

When I load any page everything but the image loads. If I copy the address of the image into a new browser window, it just has my shared IP address. Can I change something to use the full host name or cant I use it on a shared host?

 

Thanks Shawn

Is your question related to the Anti Robot Registration Validation v2.5? Or you just installed osCommerce and all your images didn't show up?

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.

Link to comment
Share on other sites

Is your question related to the Anti Robot Registration Validation v2.5? Or you just installed osCommerce and all your images didn't show up?

 

 

Alex yes its on Anti Robot. When I open a validation page the image dosn't show up. When I tell it to open the image in a new window. When the image opens in the new windows the address that shows up is my shared IP with a 500 error. Because of this I figured it was a shrared hosting problem. I just say aprt of the problem above mine and I'll re-read it to see if its the same.

 

Shawn

Link to comment
Share on other sites

Alex yes its on Anti Robot. When I open a validation page the image dosn't show up. When I tell it to open the image in a new window. When the image opens in the new windows the address that shows up is my shared IP with a 500 error. Because of this I figured it was a shrared hosting problem. I just say aprt of the problem above mine and I'll re-read it to see if its the same.

 

Shawn

 

 

Here is a link to my create My create account page.

Edited by bob21115
Link to comment
Share on other sites

I did the fix on page 11 and still dosn't work. But the post install dosn't work either. I copied the two session_id's from the database and pasted in a browser and get the same 500 error. I'm going to double check the install.

Edited by bob21115
Link to comment
Share on other sites

I did the fix on page 11 and still dosn't work. But the post install dosn't work either. I copied the two session_id's from the database and pasted in a browser and get the same 500 error. I'm going to double check the install.

It is something about your hosting provider. Your site is based on shared IP redirecting, and there probably is some restiction which caused the png image not to be shown.

Edited by AlexStudio

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.

Link to comment
Share on other sites

For those with modded oscommerce stores that have the 'no validation image showing on the web page' problem and have the same issue with the suggested post-install test.

 

have you made any mods to application_top.php?

 

if so you may be outputting headers etc prior to the content-type output in validation_png.php.

 

you may wish to try the following as a solution:

 

comment out

 

require('includes/application_top.php');

 

at the top of validation_png.php

 

insert the following code beneath the newly commented line

 

// include necessary pre-amble
error_reporting(0);
require_once('includes/configure.php');
define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
require_once(DIR_WS_INCLUDES . 'filenames.php');
require_once(DIR_WS_INCLUDES . 'database_tables.php');
require_once(DIR_WS_FUNCTIONS . 'database.php');
tep_db_connect() or die('Unable to connect to database server!');

$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
while ($configuration = tep_db_fetch_array($configuration_query)) {
	define($configuration['cfgKey'], $configuration['cfgValue']);
}
// End - include

 

Hope that helps somebody!

 

Good luck!

Link to comment
Share on other sites

After installing the version 2.5 of the mod,

It does not seam to work correctly.

 

I can go to my contact us page

 

"http://www.tranquilsense.com/contact_us.php"

 

And just hit Continue and I am prompted

 

Invalid Validation Code

Your E-Mail Address does not appear to be valid - please make any necessary corrections.

Your E-Mail Address does not appear to be valid - please make any necessary corrections.

 

(notice how this displays twice)

 

But if I enter a name and email, then hit continue, it will send. Not prompting me to enter or Invalid Validation Code.

 

Check my mail and it does in fact process. It only seems to happen onmy contact us page.

 

Thanks for any direction I can go with this to resolve.

_________________________________________________________________________

 

David G Aschenbrener

Tranquil | Sense - Your Stop for Tranquility.

Link to comment
Share on other sites

After installing the version 2.5 of the mod,

It does not seam to work correctly.

 

I can go to my contact us page

 

"http://www.tranquilsense.com/contact_us.php"

 

And just hit Continue and I am prompted

 

Invalid Validation Code

Your E-Mail Address does not appear to be valid - please make any necessary corrections.

Your E-Mail Address does not appear to be valid - please make any necessary corrections.

 

(notice how this displays twice)

 

But if I enter a name and email, then hit continue, it will send. Not prompting me to enter or Invalid Validation Code.

 

Check my mail and it does in fact process. It only seems to happen onmy contact us page.

 

Thanks for any direction I can go with this to resolve.

Did you have any previous modification to the contact_us.php?

 

If not, you can try to replace it with the one came with v2.5 package and see how it goes.

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.

Link to comment
Share on other sites

Did you have any previous modification to the contact_us.php?

 

If not, you can try to replace it with the one came with v2.5 package and see how it goes.

 

Once again this had worked.

 

Thanks

 

I cannot remember if I had modified or not .

 

But replacing the file your file corrected my issue.

 

:D

_________________________________________________________________________

 

David G Aschenbrener

Tranquil | Sense - Your Stop for Tranquility.

Link to comment
Share on other sites

For those with modded oscommerce stores that have the 'no validation image showing on the web page' problem and have the same issue with the suggested post-install test.

 

have you made any mods to application_top.php?

 

if so you may be outputting headers etc prior to the content-type output in validation_png.php.

 

you may wish to try the following as a solution:

 

comment out

 

require('includes/application_top.php');

 

at the top of validation_png.php

 

insert the following code beneath the newly commented line

 

// include necessary pre-amble
error_reporting(0);
require_once('includes/configure.php');
define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
require_once(DIR_WS_INCLUDES . 'filenames.php');
require_once(DIR_WS_INCLUDES . 'database_tables.php');
require_once(DIR_WS_FUNCTIONS . 'database.php');
tep_db_connect() or die('Unable to connect to database server!');

$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
while ($configuration = tep_db_fetch_array($configuration_query)) {
	define($configuration['cfgKey'], $configuration['cfgValue']);
}
// End - include

 

Hope that helps somebody!

 

Good luck!

 

I cannot THANK YOU!!!! enough for this! I went through every page in this thread trying all of the tips and finally - (on the last page - LOL) I found this one and IT WORKED!!! :D :thumbsup:

 

Now - I do have one weird thing happening that I don't recall seeing posted on prior pages. I was going through the create_account, account_edit, account_password and contact_us pages to verify all was working correctly and for some reason the code duplicates itself.

 

ie... I go create an account and it gives me the code h29tx for example - and then once I have succesfully created my account I go to edit account and it loads the same code of h29tx - so of course when I enter the code and click to submit it tells me Invalid Code and has a new code for me to enter. Let's say this new code is htz3r. So I enter it, succesfully edit my account and then I go to change my password. Guess what - when the page loads it has code htz3r and again I have to enter the code - get the error and the new code, and then I can succesfully change my password. I then click to Contact Us and boom - the new code from the last page is what is now loaded on the Contact page :huh:

 

Any idea why it is reloading the same code when you pull up a new page and forcing you to have to enter an invalid code before it gives you a new one?

~Tracy
 

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...