Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW PARSE ERROR


Guest

Recommended Posts

UGH, Im getting a new parse error now when clicking the link after payment to dl the digital products:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/XXXX/public_html/catalog/download.php on line 23

 

// Check that order_id, customer_id and filename match  $downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = . $customer_id . "' and o.orders_id = . (int)$HTTP_GET_VARS['order'] . "' and o.orders_status = '3' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != '"); 

 

This is a change to the original code, which is supposed to prevent abuse of the downloads. Downloads available ONLY AFTER payment has been made. Any ideas of what I did wrong? I followed a previous post's instructions and have checked and rechecked. It seem sto be working for others, why not me?

 

If anyone can help me figure out what the heck is wrong, I would be eternally grateful.

 

Michelle

 

PS: AND WHY IS THIS BOX SO DARN LONG? HOW DO YOU GUYS MAKE IT FIT THE PAGE? Ugh.

Link to comment
Share on other sites

Curious...

 

TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS............

 

I wonder if that "o" should be "op" like every other instance. Would that be the problem? A typo in her instructions?

Link to comment
Share on other sites

Is that really how the line appears? It should be

/ Check that order_id, customer_id and filename match 
$downloads_query...

If the actual code is one line, then you need to change it. If not, then please post it again as it is.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

you are correct. It does not appear that way in the file...that is how it copied over. However, after the word "match" and it starts on the next line, that one IS one line in the Code Editor, which is where I copied it from.

 

I appreciate your looking at my problem and attempting to help me. any ideas?

Link to comment
Share on other sites

I was c/p the code from the host's file manager of my main website, which is for info stuff only, not a store. I did it this time from OSCommerce's file manager, which is probably where I should have done it in the first place. Here it is.

 

// Check that order_id, customer_id and filename match
 $downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-
%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count,
opd.download_maxdays, opd.orders_products_filename from " .
TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " .
TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = .
$customer_id . "' and o.orders_id = . (int)$HTTP_GET_VARS['order'] . "' and
o.orders_status = '3' and o.orders_id = op.orders_id and op.orders_products_id =
opd.orders_products_id and opd.orders_products_download_id = '" . (int)
$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != '");
 if (!tep_db_num_rows($downloads_query)) die;
 $downloads = tep_db_fetch_array($downloads_query);

 

I went down two further lines of code for you. I appreciate your help, I really need to get this going as it appears I may soon be a single mother @@. I thank you so much for your time and efforts to help me.

 

Michelle

 

When posting this, it still c/p as really long, but in the file manager, it is much smaller and broken down into smaller lines of code, I am going to add line breaks here as the code is shown to me in the file manager.

 

Done, there it is as it appears in the box when I click on the file, then edit.

 

Thanks.

Link to comment
Share on other sites

Try

 

// Check that order_id, customer_id and filename match
$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-
%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count,
opd.download_maxdays, opd.orders_products_filename from " .
TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " .
TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" .
$customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and
o.orders_status = '3' and o.orders_id = op.orders_id and op.orders_products_id =
opd.orders_products_id and opd.orders_products_download_id = '" . (int)
$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != '");
if (!tep_db_num_rows($downloads_query)) die;
$downloads = tep_db_fetch_array($downloads_query);

Link to comment
Share on other sites

Oh my! The error is huge this time!

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 4

 

select date_format(o.date_purchased, '%Y- %m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from orders o, orders_products op, orders_products_download opd where o.customers_id = '2' and o.orders_id = '9' and o.orders_status = '3' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '2' and opd.orders_products_filename != '

 

[TEP STOP]

 

Is that a new error, or did you put something in there for it to tell what was wrong? LOL Kinda freaked me out.

 

Appreciate your time and help, Mr. Fisher.

 

Michelle

Link to comment
Share on other sites

Okay, are you guys sick of me yet?

 

I put a fresh, original file back in. The parse errors are gone, however, I am now just going to a blank page after clicking the dl link. And this still leaves me with the problem of someone being able to abuse the download.

 

Any ideas? Maybe we should just start from here and forget all the changes to the code that I followed from the other poster.

 

If you want to, please go to www.clearcreekscraps.com/catalog and you can see what my product is. After purchase of the kits, the customer needs to be able to download it. I have gotten the links to come up after purchase, but like I said, I am only getting a blank page with the original code. I have my product in the proper download folder, they are all in lowercase letters and in a zip file.

 

**sigh**

 

Will appreciate any help.

 

Michelle

Link to comment
Share on other sites

I was c/p the code from the host's file manager of my main website, which is for info stuff only, not a store. I did it this time from OSCommerce's file manager, which is probably where I should have done it in the first place. Here it is.

 

// Check that order_id, customer_id and filename match
 $downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-
%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count,
opd.download_maxdays, opd.orders_products_filename from " .
TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " .
TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = .
$customer_id . "' and o.orders_id = . (int)$HTTP_GET_VARS['order'] . "' and
o.orders_status = '3' and o.orders_id = op.orders_id and op.orders_products_id =
opd.orders_products_id and opd.orders_products_download_id = '" . (int)
$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != '");
 if (!tep_db_num_rows($downloads_query)) die;
 $downloads = tep_db_fetch_array($downloads_query);

 

I went down two further lines of code for you. I appreciate your help, I really need to get this going as it appears I may soon be a single mother @@. I thank you so much for your time and efforts to help me.

 

Michelle

 

When posting this, it still c/p as really long, but in the file manager, it is much smaller and broken down into smaller lines of code, I am going to add line breaks here as the code is shown to me in the file manager.

 

Done, there it is as it appears in the box when I click on the file, then edit.

 

Thanks.

Don't use the admin file manager, ftp the file to your pc and edit it there.

 

Have you looked at the downloads controller addon?

Link to comment
Share on other sites

please go to www.clearcreekscraps.com/catalog and you can see what my product is. After purchase of the kits, the customer needs to be able to download it. I have gotten the links to come up after purchase, but like I said, I am only getting a blank page with the original code. I have my product in the proper download folder, they are all in lowercase letters and in a zip file.
I'm having a difficult time trying to figure out what the problem is. But if you are getting a blank page, the reason is usually that you uploaded the file to the wrong directory. There are two files for each page: one in the root and one in the english directory. If you upload the latter to the root, a blank page will display. Maybe that is the problem.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I'm having a difficult time trying to figure out what the problem is. But if you are getting a blank page, the reason is usually that you uploaded the file to the wrong directory. There are two files for each page: one in the root and one in the english directory. If you upload the latter to the root, a blank page will display. Maybe that is the problem.

 

Jack

 

 

 

thanks for the info...will check

 

Michelle

Link to comment
Share on other sites

Don't use the admin file manager, ftp the file to your pc and edit it there.

 

Have you looked at the downloads controller addon?

 

 

Good idea...I didnt think of doing that. I have also dl the downloads controller, however, havent had an opportunity to set it up yet. I have also dl the easy registration add-on to keep people from having to give their life story when they register...LOL Not set that up yet either. Hoping to later tonite or tomorrow. Will let you know how it goes.

 

Thanks for the help!

Link to comment
Share on other sites

OMG, THE DOWNLOAD LINKS ARE WORKING AFTER PAYMENT!!!!! Im not sure which tip helped, but one of them did! I am soooo very happy. Thank you guys sooooooo much!!!

 

I am concerned however. I listed an item for a penny and had a friend and my mother both purchase and try to dl. They were both able to purchase and download, however, my friend paid with an e-check through paypal and was able to download immediately. What stops people who pay that way from downloading the product then cancelling their payment afterwards? Trying to prevent that with a tip/code change from someone that was posted previously is what screwed me up to begin with. Does anyone have any ideas or input?

 

Thanks a million,

Michelle

 

: D

Link to comment
Share on other sites

OMG, THE DOWNLOAD LINKS ARE WORKING AFTER PAYMENT!!!!! Im not sure which tip helped, but one of them did! I am soooo very happy. Thank you guys sooooooo much!!!

 

I am concerned however. I listed an item for a penny and had a friend and my mother both purchase and try to dl. They were both able to purchase and download, however, my friend paid with an e-check through paypal and was able to download immediately. What stops people who pay that way from downloading the product then cancelling their payment afterwards? Trying to prevent that with a tip/code change from someone that was posted previously is what screwed me up to begin with. Does anyone have any ideas or input?

 

Thanks a million,

Michelle

 

: D

That is fantastic, now try the downloads controller addon.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...