j158y Posted November 26, 2003 Share Posted November 26, 2003 I try to make change in direct.php when the url is clicked, some data should be insert in the database,but it doesn't work. Only date exit in the file. The other fields are empty. Why? Thanks. case 'url': if (isset($HTTP_GET_VARS['goto'])) { //add $customer = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $HTTP_GET_VARS['customer_id'] . "'"); $customer_values = tep_db_fetch_array($customer); $articles = tep_db_query("select articles_id, articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . $HTTP_GET_VARS['articles_id'] . "'"); $articles_values = tep_db_fetch_array($articles); $articles_points = tep_db_query("select articles_id, articles_price from " . TABLE_ARTICLES . " where articles_id = '" . $HTTP_GET_VARS['articles_id'] . "'"); $articles_points_values = tep_db_fetch_array($articles_points); $date_now = date('Ymd'); tep_db_query("insert into " . TABLE_ARTICLES_POINTS . " (customers_id,customers_name,articles_id,articles_name,date,articles_points) values ('" . $customer_id . "', '" . addslashes($customer_values['customers_firstname']) . "','" . $HTTP_GET_VARS['articles_id'] . "','" . addslashes($articles_values['articles_name']) . "',now(),'" . addslashes($articles_points_values['articles_price']) . "')"); //add end tep_redirect($HTTP_GET_VARS['goto']); } else { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } break; Quote Link to comment Share on other sites More sharing options...
Guest Posted November 26, 2003 Share Posted November 26, 2003 That code looks correct (except that you don't check that the GET_VARS aren't null). Where is the code that makes the URL on which you would be clicking? Hth, Matt Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.