I am trying to post data to a zen cart page, but curl doesnt work. It doesnt matter what I try to do, even if it's just trying to obtain the headers, I get 404 errors or I get 302 errors (depending on the page and what I'm trying to do). Ultimately, I need to be able to log in as a user and complete a transaction from the command line but that seems impossible given the 302 errors.

For example, this is what I type to obtain the headers:

curl -I -3 www.splitsum.com/zcart/index.php?main_page=product_info&cPath=0&products_id=1

And this is the return:

HTTP/1.1 404 Not Found
Date: Tue, 12 Nov 2013 20:52:59 GMT
Server: Apache

Does anyone know what might be causing this? I installed a different shopping cart on the same server and can access it and complete transactions via curl without a problem, but I am not having the same luck with Zen Cart. Any help would be appreciated.

Thank you.

有帮助吗?

解决方案

zen-cart has prevention from robots you can try to send different headers basically when you change User-Agent it should work

this worked for me copying from my own browser :

curl --user-agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0" -I -3 "www.splitsum.com/zcart/index.php?main_page=product_info&cPath=0&products_id=1"

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top