Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

click the url-link and the data would be saved


j158y

Recommended Posts

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;

Link to comment
Share on other sites

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

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.
Note: Your post will require moderator approval before it will be visible.

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