Re: disallowing more than one review
VegasVik <[email protected]> 11 Sep 2003 20:55:21 -0000
| Newsgroups | gmane.comp.web.oscommerce.tips |
|---|---|
| Message-ID | <50617246a9416f0d72d799a391fd1176@osCommerce-Forums> |
This message was sent from: Tips and Tricks
http://forums.oscommerce.com/viewtopic.php?p=228073#228073
----------------------------------------------------------------
This could be handy. However, my product_reviews_write.php file doesn't contain the code listed.
The closest I have is the following:
[code]
if (@$HTTP_GET_VARS['action'] == 'process') {
$customer = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$customer_values = tep_db_fetch_array($customer);
$date_now = date('Ymd');
tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . $HTTP_GET_VARS['products_id'] . "', '" . $customer_id . "', '" . addslashes($customer_values['customers_firstname']) . ' ' . addslashes($customer_values['customers_lastname']) . "', '" . $HTTP_POST_VARS['rating'] . "', now())");
$insert_id = tep_db_insert_id();
tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . $insert_id . "', '" . $languages_id . "', '" . $HTTP_POST_VARS['review'] . "')");
tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, $HTTP_POST_VARS['get_params'], 'NONSSL'));
}
[/code]
I have osc 2.2.