Jump to content
olsonsp4c

osC reCaptcha

Recommended Posts

It could be that the form tag has not been moved into proper placement, that is my guess - i looked at the rest of the code and it looks good - I have it working on three different sites currently for customer_testimonials and have installed for many other clients and it dropped in just fine... wish I could help more.

 

Scott

 

What is the "form tag"?

Thanks

Lollo

Share this post


Link to post
Share on other sites
What is the "form tag"?

Thanks

Lollo

 

I got it working now, by moving the form as you suggested. Thank you!!

Very good contribution.

Lollo

Share this post


Link to post
Share on other sites
I got it working now, by moving the form as you suggested. Thank you!!

Very good contribution.

Lollo

 

I'm glad - I apologize for not getting back with you yesterday... however, I remember when I first started with osC and the learning curve with the code was quite large and a real learning experience! Now you've helped someone else who might have the same problem...

 

Just in case someone else is reading this and has a similar issue - any mods to the customers_testimonials_write.php file will require you to make sure that the "<form...>" and "</form>" tags are in their proper place (started and ended next to the same <table>, <tr>, or <td> AND </table>, </tr>, or </td> tags respectively) in the code logic to make sure the reCaptcha is included in the submission...

 

Scott

Share this post


Link to post
Share on other sites

Hi Everyone

 

I am using v1.4.4 of this great contribution and i have an error appearing when i use IE.

 

The error i am getting is:

 

Line: 671

Char: 5

Error: Expected identifier, string or number

Code: 0

URL: https://localhost/shop/catalog/create_accou...osCsid=(SESSION ID)

 

The section the error is on is in:

 

<!-- BOC - osC reCaptcha v1.4.4 -->
     <tr>
       <td class="main"><b><?php echo ENTRY_SECURITY_CHECK1; ?></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
			$languages_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where directory = '" . $language . "'");
			$language_id = tep_db_fetch_array($languages_query);
			?>
			<script>
			var RecaptchaOptions = {
			theme : 'clean',
			tabindex : 3,
			lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>',
			};
			</script>
			<td><?php echo recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, null, ($request_type == 'SSL')); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<!-- EOC - osC reCaptcha v1.4.4 -->

 

The line the error is on is below the following code:

 

        <td class="main"><b><?php echo ENTRY_SECURITY_CHECK1; ?></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">

 

The error line is:

 

		  <tr>

 

I am sure it is something simple but i am not too fluent with php .. just know how to follow instructions in the install notes.

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites
I'm glad - I apologize for not getting back with you yesterday... however, I remember when I first started with osC and the learning curve with the code was quite large and a real learning experience! Now you've helped someone else who might have the same problem...

 

Just in case someone else is reading this and has a similar issue - any mods to the customers_testimonials_write.php file will require you to make sure that the "<form...>" and "</form>" tags are in their proper place (started and ended next to the same <table>, <tr>, or <td> AND </table>, </tr>, or </td> tags respectively) in the code logic to make sure the reCaptcha is included in the submission...

 

Scott

 

Just as a note, <form>...</form> tags (when in tables) belong inside <td>...</td> tags. Anywhere else is an error, though most browsers will figure out what to do.

 

In osC, the <form> tag is usually generated by a call to tep_draw_form(), but the closing </form> tag must be placed manually.

 

--Glen

Share this post


Link to post
Share on other sites
Hi Everyone

 

I am using v1.4.4 of this great contribution and i have an error appearing when i use IE.

 

The error i am getting is:

 

Line: 671

Char: 5

Error: Expected identifier, string or number

Code: 0

URL: https://localhost/shop/catalog/create_accou...osCsid=(SESSION ID)

 

The section the error is on is in:

 

     <tr>
       <td class="main"><b><?php echo ENTRY_SECURITY_CHECK1; ?></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
			$languages_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where directory = '" . $language . "'");
			$language_id = tep_db_fetch_array($languages_query);
			?>
			<script>
			var RecaptchaOptions = {
			theme : 'clean',
			tabindex : 3,
			lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>',
			};
			</script>
			<td><?php echo recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, null, ($request_type == 'SSL')); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>

 

The line the error is on is below the following code:

 

        <td class="main"><b><?php echo ENTRY_SECURITY_CHECK1; ?></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">

 

The error line is:

 

		  <tr>

 

I am sure it is something simple but i am not too fluent with php .. just know how to follow instructions in the install notes.

 

Any help would be appreciated.

 

I don't see an error, so I'm wondering if IE is counting lines differently that the program you are using that counts them...

 

Scott

Share this post


Link to post
Share on other sites

You are right. I looked at the source in IE and saved that and opened it in Dreamweaver and the problem is line is in the code from the following:

 

	
			<script>
			var RecaptchaOptions = {
			theme : 'clean',
			tabindex : 3,
			lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>',
			};

 

This is the line the problem is in:

 

			};

 

By googling it seems either "," or a ";" is in the wrong place or needs to be removed.

 

Also the create account page takes about 10 seconds or so load whereas before it opened instantly before having recaptcha installed. If i remove recaptcha everything works fine and no errors in IE

Edited by CGhoST

Share this post


Link to post
Share on other sites

I am guessing it takes a few seconds longer because recaptcha has to get the security code so thats fine but the IE error has me baffled

Share this post


Link to post
Share on other sites
You are right. I looked at the source in IE and saved that and opened it in Dreamweaver and the problem is line is in the code from the following:

 

	
			<script>
			var RecaptchaOptions = {
			theme : 'clean',
			tabindex : 3,
			lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>',
			};

 

This is the line the problem is in:

 

			};

 

By googling it seems either "," or a ";" is in the wrong place or needs to be removed.

 

Also the create account page takes about 10 seconds or so load whereas before it opened instantly before having recaptcha installed. If i remove recaptcha everything works fine and no errors in IE

 

Please replace:

 

				lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>',
			};

 

with:

 

				lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>';
			}

 

and let me know the results...

 

Scott

Share this post


Link to post
Share on other sites
You are right. I looked at the source in IE and saved that and opened it in Dreamweaver and the problem is line is in the code from the following:

 

	
			<script>
			var RecaptchaOptions = {
			theme : 'clean',
			tabindex : 3,
			lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>',
			};

 

This is the line the problem is in:

 

			};

 

By googling it seems either "," or a ";" is in the wrong place or needs to be removed.

 

 

Also the create account page takes about 10 seconds or so load whereas before it opened instantly before having recaptcha installed. If i remove recaptcha everything works fine and no errors in IE

The problem is in the line above the "};". For some reason, the PHP code in the 'lang' definition is not being executed. It should not appear in the page source. Just as a test, try this:

				lang : 'en',

 

If the problem goes away, something is wrong on your server. In your initial post, your url was for localhost. Is PHP installed there? (You'd probably notice other problems if this were not the case.)

 

--Glen

Share this post


Link to post
Share on other sites
The problem is in the line above the "};". For some reason, the PHP code in the 'lang' definition is not being executed. It should not appear in the page source. Just as a test, try this:

				lang : 'en',

 

If the problem goes away, something is wrong on your server. In your initial post, your url was for localhost. Is PHP installed there? (You'd probably notice other problems if this were not the case.)

 

--Glen

 

Tried that and got the same error. Then i replaced the line with what Scott gave and it fixed the problem. Thank you :)

Share this post


Link to post
Share on other sites

Excellent Contribution. Installation was painless and flawless. Please keep up the great work on this as I think this should become a standard in the install file with an option to enable or not. Everything is working fine in our developmental environment using xampp. Our store will began online testing in a few days and will report back afterwards. Once again thanks.

Share this post


Link to post
Share on other sites

Hi All,

 

First of all can I thank Scott for this great contribution! Very easy and straight forward to install and great to use! I would like to offer some extra code for those of you wanting to integrate the recaptcha to either Links Manager II here or OSC Affiliate here I have only used the 'integrated' look, but will post the 'non integrated' look if anyone wants it. I must add that I used my very limited knowledge to achieve this, hence posting here rather than adding to Scott's contribution thread... there may be better logic than I have used!

 

Links Manager II

 

catalog/links_submit.php

 

find:

 

// needs to be included earlier to set the success message in the messageStack
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS_SUBMIT);
 require(DIR_WS_FUNCTIONS . 'links.php');

 

add under:

 

// start modification for reCaptcha
 require_once('includes/classes/recaptchalib.php');
// end modification for reCaptcha

 

find:

 

    $links_password = tep_db_prepare_input($_POST['links_password']);

   $error = false;

 

add under:

 

// start modification for reCaptcha
   // the response from reCAPTCHA
   $resp = null;

   // was there a reCAPTCHA response?
   $resp = recaptcha_check_answer (RECAPTCHA_PRIVATE_KEY,
   $_SERVER["REMOTE_ADDR"],
   $_POST["recaptcha_challenge_field"],
   $_POST["recaptcha_response_field"]);

   if (tep_validate_email($email_address) & ($resp->is_valid)) {
     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 {
  if (!tep_validate_email($email_address)) {
       $error = true;
       $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
  }
  if (!$resp->is_valid) {
    $error = true;
       $messageStack->add('contact', ENTRY_SECURITY_CHECK_ERROR . " (reCAPTCHA output: " . $resp->error . ")");
  }
}

// end modification for reCaptcha

 

find:

 

<td class="main"><?php echo ENTRY_LINKS_PASSWORD; ?></td>
               <td class="main"><?php echo tep_draw_password_field('links_password', $links_edit['links_partner_password']); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <?php } ?>

 

add under:

 

<!-- start modification for reCaptcha -->
		  <tr>
			<td class="main"><b><?php echo ENTRY_SECURITY_CHECK; ?></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
			$languages_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where directory = '" . $language . "'");
			$language_id = tep_db_fetch_array($languages_query);
			?>
			<script>
			var RecaptchaOptions = {
			theme : 'clean',
			tabindex : 3,
			lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>'
			};
			</script>
			<td><?php echo recaptcha_get_html(RECAPTCHA_PUBLIC_KEY); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<!-- end modification for reCaptcha -->

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

 

 

 

OSC Affiliate

 

catalog/affiliate_signup.php

 

find:

 

require('includes/application_top.php');

 

add under:

 

// start modification for reCaptcha
 require_once('includes/classes/recaptchalib.php');
// end modification for reCaptcha

 

find:

 

    $a_agb = tep_db_prepare_input($HTTP_POST_VARS['a_agb']);

   $error = false; // reset error flag

 

add under:

 

// start modification for reCaptcha
// the response from reCAPTCHA
   $resp = null;

   // was there a reCAPTCHA response?
   $resp = recaptcha_check_answer (RECAPTCHA_PRIVATE_KEY,
   $_SERVER["REMOTE_ADDR"],
   $_POST["recaptcha_challenge_field"],
   $_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
    $error = true;

       $messageStack->add('friend', ENTRY_SECURITY_CHECK_ERROR . " (reCAPTCHA output: " . $resp->error . ")");
}
// end modification for reCaptcha

 

find:

 

  require(DIR_WS_MODULES . 'affiliate_signup_details.php');
?>
       </td>

 

add under:

 

<!-- start modification for reCaptcha -->
	  <tr>
		<td class="main"><b><?php echo ENTRY_SECURITY_CHECK1; ?></b></td>
	  </tr>
	  <tr>
		<?php
		$languages_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where directory = '" . $language . "'");
		$language_id = tep_db_fetch_array($languages_query);
		?>
		<script>
		var RecaptchaOptions = {
		theme : 'clean',
		tabindex : 3,
		lang : '<?php if (in_array($language_id['code'] ,array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {echo $language_id['code']; } else {echo 'en'; } ?>'
		};
		</script>
		<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
             <tr class="infoBoxContents">
		<td><?php echo recaptcha_get_html(RECAPTCHA_PUBLIC_KEY); ?></td>
		  </tr>
		</table></td>
	  </tr>
<!-- end modification for reCaptcha -->

 

I hope the above helps a few people... if you have any ideas on changing the code logic... please let me know!

 

James

Share this post


Link to post
Share on other sites

Hi

I have this in my create_account.php and it works. However, in firefox, if I in my browser menu, go to Tools -> Settings and there Settings again and tick the box saying: "Show warning messages when a page contain both encrypted and unencrypted information" , then this warning message pops up.

 

So I looked at all my images with Web Developer and the ReCaptcha images were not from https but http. Then I disabled the ReCaptcha function and the warning message was gone. So does this mean I have added it wrong to my page? If so, how do I do to fetch the ReCaptcha images from https instead?

Share this post


Link to post
Share on other sites
Hi

I have this in my create_account.php and it works. However, in firefox, if I in my browser menu, go to Tools -> Settings and there Settings again and tick the box saying: "Show warning messages when a page contain both encrypted and unencrypted information" , then this warning message pops up.

 

So I looked at all my images with Web Developer and the ReCaptcha images were not from https but http. Then I disabled the ReCaptcha function and the warning message was gone. So does this mean I have added it wrong to my page? If so, how do I do to fetch the ReCaptcha images from https instead?

 

how to do this is already in the installation instructions.

Scott

Share this post


Link to post
Share on other sites

Sorry missed that.

 

I have to have my own SSL cert in order to make it work, right? I don't have that, it's shared. So that leaves me with some of the other contributions, I guess.

Share this post


Link to post
Share on other sites

i've not tried it with a shared cert; however, you could try using the instructions as is and see if they work for you - I think they should work just fine because even shared certs allow for https://

 

Scott

Share this post


Link to post
Share on other sites

I tried, but got this message: This reCAPTCHA key isn't authorized for the given domain. More info

 

I'll take a closer look tomorrow.

 

Anyway, thanks for your help. :)

Share this post


Link to post
Share on other sites
I tried, but got this message: This reCAPTCHA key isn't authorized for the given domain. More info

 

I'll take a closer look tomorrow.

 

Anyway, thanks for your help. :)

 

I have this very same problem. :-(

 

I use a shared SSL, and though I have my catalog set up fine,

but when I use the non ssl option, I get that dreded warning about pages

not being secure warning.

 

Would make customers feel concerned. I tried choosing show both secure and non secure.

But then the page defaults out of ssl too http from https.

 

When I choose do not show non secure, then the captcha fails and wont load at all.

 

Like, with full ssl, you would have:

 

https://mywebsite.com

 

But with a shared you have:

 

https://otherwebsite.com/~a_user_name_here/...ate_account.php?

 

With out the ability to some how tell the contirb to default to the shared SSL, I know me have no clue

how I could use this.

 

I get warning if using non ssl, in shared ssl mode, and warning above if I set it to use standard SSL.

 

:-(

 

Using now Rc2a, and reCaptcha 1.4

Share this post


Link to post
Share on other sites

I am very interested in adding this to my wishilist.php page. Has anyone sucessfully added recaptcha to wish list? I tried to hack the code a bit but couldnt get it to work properly. Here's the code (without recaptcha)

 

<?php
/*
 $Id: wishlist.php,v 3.0  2005/04/20 Dennis Blake
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Released under the GNU General Public License
*/
// This version, removes the product when adding to a cart now, replaced all of the  HTTP_POST_VARS for $_POST

 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST);

/*******************************************************************
******* ADD PRODUCT TO WISHLIST IF PRODUCT ID IS REGISTERED ********
*******************************************************************/

 if(tep_session_is_registered('wishlist_id')) {
$wishList->add_wishlist($wishlist_id, $attributes_id);
/*******************************************************************
******* CREATES COOKIE TO STORE WISHLIST ON LOCAL COMPUTER  ********
********************************************************************
******* TO CHANGE THE LENGTH OF TIME THE COOKIE IS STORED:  ********
*******													 ********
******* EDIT THE "DAYS" VARIABLE BELOW.  THIS VARIABLE IS   ********
******* THE NUMBER OF DAYS THE COOKIE IS STORED.			********
*******************************************************************/	
//	$days = 30;																															
//	$time = time() + (3600 * 24 * $days);
// 	$cook_id = serialize($wishList->wishID);
//	tep_setcookie('wish', $cook_id , $time);
/***********************END CHANGE*********************************/

if(WISHLIST_REDIRECT == 'Yes') {
	tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id));
} else {
	tep_session_unregister('wishlist_id');
}
 }


/*******************************************************************
****************** ADD PRODUCT TO SHOPPING CART ********************
*******************************************************************/

 if (isset($_POST['add_wishprod'])) {
if(isset($_POST['add_prod_x'])) {
	foreach ($_POST['add_wishprod'] as $value) {
		$product_id = tep_get_prid($value);
		$cart->add_cart($product_id, $cart->get_quantity(tep_get_uprid($product_id, $_POST['id'][$value]))+1, $_POST['id'][$value]);
		$wishList->remove($value);
		}
	}
}



/*******************************************************************
****************** DELETE PRODUCT FROM WISHLIST ********************
*******************************************************************/

 if (isset($_POST['add_wishprod'])) {
if(isset($_POST['delete_prod_x'])) {
	foreach ($_POST['add_wishprod'] as $value) {
		$wishList->remove($value);
	}
}
 }


/*******************************************************************
************* EMAIL THE WISHLIST TO MULTIPLE FRIENDS ***************
*******************************************************************/

 if (isset($_POST['email_prod_x'])) {

	$errors = false;
	$guest_errors = "";
	$email_errors = "";
	$message_error = "";

	if(strlen($_POST['message']) < '1') {
		$error = true;
		$message_error .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_MESSAGE . "</div>";
	}			

	  if(tep_session_is_registered('customer_id')) {
		$customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
		  $customer = tep_db_fetch_array($customer_query);

		$from_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
		$from_email = $customer['customers_email_address'];
		$subject = $customer['customers_firstname'] . ' ' . WISHLIST_EMAIL_SUBJECT;
		$link = HTTP_SERVER . DIR_WS_CATALOG . FILENAME_WISHLIST_PUBLIC . "?public_id=" . $customer_id;

	//REPLACE VARIABLES FROM DEFINE
		$arr1 = array('$from_name', '$link');
		$arr2 = array($from_name, $link);
		$replace = str_replace($arr1, $arr2, WISHLIST_EMAIL_LINK);
		$message = tep_db_prepare_input($_POST['message']);
		$body = $message . $replace;
	} else {
		if(strlen($_POST['your_name']) < '1') {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_YOUR_NAME . "</div>";
		}
		if(strlen($_POST['your_email']) < '1') {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " .ERROR_YOUR_EMAIL . "</div>";
		} elseif(!tep_validate_email($_POST['your_email'])) {
			$error = true;
			$guest_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_VALID_EMAIL . "</div>";
		}

		$from_name = stripslashes($_POST['your_name']);
		$from_email = $_POST['your_email'];
		$subject = $from_name . ' ' . WISHLIST_EMAIL_SUBJECT;
		$message = stripslashes($_POST['message']);

		$z = 0;
		$prods = "";
		foreach($_POST['prod_name'] as $name) {
			$prods .= stripslashes($name) . "  " . stripslashes($_POST['prod_att'][$z]) . "\n" . $_POST['prod_link'][$z] . "\n\n";
			$z++;
		}
		$body = $message . "\n\n" . $prods . "\n\n" . WISHLIST_EMAIL_GUEST;
	  }

	//Check each posted name => email for errors.
	$j = 0;
  $email = $_POST['email'];
	foreach($_POST['friend'] as $friendx) {
		if($j == 0) {
			if($friend[0] == '' && $email[0] == '') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ONE_EMAIL . "</div>";
			}
		}

		if(isset($friendx) && $friendx != '') {
			if(strlen($email[$j]) < '1') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ENTER_EMAIL . "</div>";
			} elseif(!tep_validate_email($email[$j])) {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_VALID_EMAIL . "</div>";
			}
		}

		if(isset($email[$j]) && $email[$j] != '') {
			if(strlen($friendx) < '1') {
				$error = true;
				$email_errors .= "<div class=\"messageStackError\"><img src=\"images/icons/error.gif\" /> " . ERROR_ENTER_NAME . "</div>";
			}
		}
		$j++;
	}
	if($error == false) {
		$j = 0;
		foreach($_POST['friend'] as $friendx) {
			if($friendx != '') {
				tep_mail($friendx, $email[$j], $subject, $friendx . ",\n\n" . $body, $from_name, $from_email);
			}

		//Clear Values
			$friend[$j] = "";
			$email[$j] = "";
			$message = "";

			$j++;
		}

		$messageStack->add('wishlist', WISHLIST_SENT, 'success');
	}
 }


$breadcrumb->add(NAVBAR_TITLE_WISHLIST, tep_href_link(FILENAME_WISHLIST, '', 'SSL'));
?>
<!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 (getenv('HTTPS') == 'on' ? 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('wishlist_form', tep_href_link(FILENAME_WISHLIST)); ?>
  <table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td>
	  <table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading" colspan="3"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_wishlist.gif', HEADING_TITLE, 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('wishlist') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('wishlist'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }


if (is_array($wishList->wishID) && !empty($wishList->wishID)) {
reset($wishList->wishID);

?>
  <tr>
	<td>
	<table border="0" width="100%" cellspacing="0" cellpadding="3" class="productListing">
	  <tr>
			<td class="productListing-heading"><?php echo BOX_TEXT_IMAGE; ?></td>
			<td class="productListing-heading"><?php echo BOX_TEXT_PRODUCT; ?></td>
			<td class="productListing-heading"><?php echo BOX_TEXT_PRICE; ?></td>
			<td class="productListing-heading" align="center"><?php echo BOX_TEXT_SELECT; ?></td>
	  </tr>

<?php
	$i = 0;
	while (list($wishlist_id, ) = each($wishList->wishID)) {

		$product_id = tep_get_prid($wishlist_id);

		$products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.products_status, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ( " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where pd.products_id = '" . $product_id . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
		$products = tep_db_fetch_array($products_query);

		  if (($i/2) == floor($i/2)) {
			$class = "productListing-even";
		  } else {
			$class = "productListing-odd";
		  }

?>
			  <tr class="<?php echo $class; ?>">
				<td valign="top" class="productListing-data" align="left"><?php if($products['products_status'] == 0) {
			   			 echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
			   			}
						else
						{
						?>
			   <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>"><?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></a>
			   <?php } ?>

				<td valign="top" class="productListing-data" align="left" class="main"><b><?php if($products['products_status'] == 0) {
				echo $products['products_name']; 
				}
				else {
				?>
				<a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>"><?php echo $products['products_name']; ?></a>
				<?php } ?></b>
				<input type="hidden" name="prod_link[]" value="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>" />
				<input type="hidden" name="prod_name[]" value="<?php echo $products['products_name']; ?>" />
<?php



/*******************************************************************
******** THIS IS THE WISHLIST CODE FOR PRODUCT ATTRIBUTES  *********
*******************************************************************/

			  $attributes_addon_price = 0;

			  // Now get and populate product attributes
				$att_name = "";
				if (isset($wishList->wishID[$wishlist_id]['attributes'])) {
					while (list($option, $value) = each($wishList->wishID[$wishlist_id]['attributes'])) {
						  echo tep_draw_hidden_field('id[' . $wishlist_id . '][' . $option . ']', $value);

	 					$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
								  from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
								  where pa.products_id = '" . $wishlist_id . "'
								   and pa.options_id = '" . $option . "'
								   and pa.options_id = popt.products_options_id
								   and pa.options_values_id = '" . $value . "'
								   and pa.options_values_id = poval.products_options_values_id
								   and popt.language_id = '" . $languages_id . "'
								   and poval.language_id = '" . $languages_id . "'");
						$attributes_values = tep_db_fetch_array($attributes);

				   		if ($attributes_values['price_prefix'] == '+') {
							$attributes_addon_price += $attributes_values['options_values_price'];
				   		} else if($attributes_values['price_prefix'] == '-') {
					 		$attributes_addon_price -= $attributes_values['options_values_price'];
						}
						$att_name .= " (" . $attributes_values['products_options_name'] . ": " . $attributes_values['products_options_values_name'] . ") ";
				   		echo '<br /><small><i> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</i></small>';
					} // end while attributes for product

				}

				echo '<input type="hidden" name="prod_att[]" value="' . $att_name . '" />';

			   	if (tep_not_null($products['specials_new_products_price'])) {
			   		$products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';
			   	} else {
				   	$products_price = $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id']));
				}

/*******************************************************************
******* CHECK TO SEE IF PRODUCT HAS BEEN ADDED TO THEIR CART *******
*******************************************************************/

		if($cart->in_cart($wishlist_id)) {
			echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_IN_CART . '</b></font>';
		}

/*******************************************************************
********** CHECK TO SEE IF PRODUCT IS NO LONGER AVAILABLE **********
*******************************************************************/

  			if($products['products_status'] == 0) {
  				echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_NOT_AVAILABLE . '</b></font>';
		  }

		$i++;
?>
		</td>
		<td valign="top" class="productListing-data"><?php echo $products_price; ?></td>
		<td valign="top" class="productListing-data" align="center">
<?php

/*******************************************************************
* PREVENT THE ITEM FROM BEING ADDED TO CART IF NO LONGER AVAILABLE *
*******************************************************************/

		if($products['products_status'] != 0) {
			echo tep_draw_checkbox_field('add_wishprod[]',$wishlist_id);
		}
?>
		</td>
	  </tr>

<?php
	}
?>
	</table>
	</td>
  </tr>
  <tr>
	<td align="right"><br /><?php echo tep_image_submit('button_delete.gif', 'Delete From Wishlist', 'name="delete_prod" value="delete_prod"') . " " . tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod" value="add_prod"'); ?></td>
	  </tr>
</table>
<?php

/*******************************************************************
*********** CODE TO SPECIFY HOW MANY EMAILS TO DISPLAY *************
*******************************************************************/


if(!tep_session_is_registered('customer_id')) {

?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><?php echo WISHLIST_EMAIL_TEXT_GUEST; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="center">
		<table border="0" width="400px" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main" colspan="2"><table cellpadding="2" cellspacing="0">
			  <tr>
				<td colspan="2"><?php echo $guest_errors; ?></td>
			  </tr>
			  <tr>
				<td class="main"><?php echo TEXT_YOUR_NAME; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_name', $your_name); ?></td>
				</tr>
				<tr>
				<td class="main"><?php echo TEXT_YOUR_EMAIL; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_email', $your_email); ?></td>
				</tr>
			</table></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
<?php 

} else {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><?php echo WISHLIST_EMAIL_TEXT; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="center">
		<table border="0" width="400px" cellspacing="0" cellpadding="2">

<?php

}

?>
		  <tr>
			<td colspan="2"><?php echo $email_errors; ?></td>
		  </tr>
<?php

$email_counter = 0;
while($email_counter < DISPLAY_WISHLIST_EMAILS) {
?>
		  <tr>
			<td class="main"><?php echo TEXT_NAME; ?>  <?php echo tep_draw_input_field('friend[]', $friend[$email_counter]); ?></td>
			<td class="main"><?php echo TEXT_EMAIL; ?>  <?php echo tep_draw_input_field('email[]', $email[$email_counter]); ?></td>
		  </tr>
<?php
$email_counter++;
}
?>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo $message_error; ?></td>
		  </tr>
		  <tr>
			<td colspan="2" class="main"><?php echo TEXT_MESSAGE .  tep_draw_textarea_field('message', 'soft', 45, 5); ?></td>
		  </tr>
		  <tr>
			<td colspan="2" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE, 'name="email_prod" value="email_prod"'); ?></td>

		  </tr>
		</table>
	</td>
  </tr>
</table>
</form>
<?php

} else { // Nothing in the customers wishlist

?>
 <tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="main"><?php echo BOX_TEXT_NO_ITEMS;?></td>
	  </tr>
	</table>
	</td>
  </tr>
</table>
</td>
 </tr>
</table>
</form>

<?php 
}
?>
<!-- customer_wishlist_eof //-->
</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'); ?>

 

Thank you in advance for your help!

Share this post


Link to post
Share on other sites

Hello,

 

I'm getting this error under IE8 - (what I'm using)

 

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET CLR 1.1.4322)
Timestamp: Wed, 22 Apr 2009 10:00:31 UTC


Message: Expected identifier, string or number
Line: 622
Char: 5
Code: 0
URI: https://www.pricelessweddings.com.au/create_account.php

 

Does anyone know what is going wrong... Thanks

Share this post


Link to post
Share on other sites
Hello,

 

I'm getting this error under IE8 - (what I'm using)

 

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET CLR 1.1.4322)
Timestamp: Wed, 22 Apr 2009 10:00:31 UTC


Message: Expected identifier, string or number
Line: 622
Char: 5
Code: 0
URI: https://www.pricelessweddings.com.au/create_account.php

 

Does anyone know what is going wrong... Thanks

 

Well, let me be the first to say; that I am in no way an expert when it comes to coding.

 

I am not qualified enough to say what it good code VS bad code.

 

However:

 

I can say, that I have a very good idea what this problem is (BUT, I do not know how to fix/correct it), because of my limitations on understanding coding.

 

The problem (I believe), is the person who wrote the instructions, in how to install the contrib, has made errors. Little as they may be, but, keep in mind, if one place leaves out, OR misses a spot in dropping a peice of code into a spot, and even 1 piece of code is either wrong, or not placed correctly. Hence you will get error on page problems.

 

Missing one _ that, or this ` or "" or a bracket can do this, and in diffrent spots.

 

Now:

 

Other things can cause this problem as well, when all the instructions are correct. When using editing software, some wont encode it correctly, and simple bump of the space key can adjust a single code.

 

However:

 

In my case, I believe the error lies in the instructions, why?

 

Because I am having simler problems after installing this contirb, and not know how to fix it, I need the instructions corrected, or the problem they caused to be listed how to fix the error after using them.

 

In my case:

 

I use dreamwever, and ftp up my files through filezilla.

AND, I did all the changes through out the instructions, AS WELL paying attention using Option B, and not option A choices. So option B applies to me, and I am not sure if A has any problems.

 

I am very lousy when it comes to coding things, However: I am VERY GOOD at following percise instructions.

 

After dropping the code into place (where instructed to), the problems showed up.

 

Now, I do understand the coder (I would think) surely knows what there doing, and I would save to bet the code is 100% correct. HOWEVER, in the kindness of putting it together, they by mistake, missed a spot where to drop it in the before or after, which ever applys.

 

Meaning:

 

That say; if you were told to drop it after the } and before the {, which I did it by the instructions percisley, is in where the error/s lie.

 

NOTE IMPORTANT!

 

I can not (with certainty) say I am correct on this, or have not a clue what I am talking about.

Because as I have stated honestly and to the best of my ability, am NOT a coder, nore do I know how to catch the problem. I can say, that another who is VERY GOOD with code, did what I did, they may come to find I am correct on this.

 

This is only my gutt instince based on knowing that I (almost 99%+) followed the instructions to the T.

 

As well have no clue how to fix it.

 

Thanks, and nothing personal towards the maker, for who am I to judge?

 

:-)

Share this post


Link to post
Share on other sites

I do not see a post for this small issue.I have the lastest contribution installed. All forms pages and the contact us page, I notice an error message in the task bar at bottom of browser. It reads as following:

 

Done, but with errors on page.

 

Now when I remove the code from the pages, the error message is gone.

 

I only see this error message in IE8, not firefox.

 

So is there something I need to add or change?

 

Thanks.

 

Bennett

Share this post


Link to post
Share on other sites
I do not see a post for this small issue.I have the lastest contribution installed. All forms pages and the contact us page, I notice an error message in the task bar at bottom of browser. It reads as following:

 

Done, but with errors on page.

 

Now when I remove the code from the pages, the error message is gone.

 

I only see this error message in IE8, not firefox.

 

So is there something I need to add or change?

 

Thanks.

 

Bennett

 

Forgot to add the http error code:

 

Site: http://brs-giftshop.com.

Error Code: 404 - Not Found

Occurred: 06/02/2009 9:29:35

Requested URL: http://brs-giftshop.com/favicon.ico

User Address: 24.144.21.250

User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)

Referer:

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

×