简体   繁体   中英

C++ cgi script gets empty environment variables as action of a form

I have a cgi c++ program on bluehost that works when you manually feed it environment variables. However, when called by a perfectly legit html form, the environment variables fail to carry a query string to the script.

Question: How do I debug this situation? Is there a way to alert the query string before it's sent? Is there a way to track the query string on the server?

You could start with the access log to see what's submitted and the error log to see if something is broken. If you can't get those from bluehost, then you could set up your own Apache server to help debug. You can also put up a simple cgi that just echos a page with what is submitted wrapped in <pre>.

Another useful debug method is ACTUALLY POST SOME CODE when asking a programming question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM