PDA

View Full Version : Qt and CGI routines



jcr
27th November 2006, 12:23
Hello,
Is Qt of any help to write a C++ CGI aplication? Or maybe there is something better inside Qt to write routines that can interact with web pages?
Thank you

patrik08
27th November 2006, 13:41
Hello,
Is Qt of any help to write a C++ CGI aplication? Or maybe there is something better inside Qt to write routines that can interact with web pages?
Thank you

Last week i have end to write a QT4.2 CMS + Ecommerce manager to handle web page....
CMS is install local on window & Mac .... or static on a usb stick...

QT can hande so good xml file & html ....
on sqlite i have put category & page on web server php5 maintain a qtsitemap to load structure on xml....

qt write xml file & upload to server on PUT method
the full application contain tidylibs xsltlibs now i have append a unzip lib to import openoffice file.... & direct transform to html + image extract & convert to jpg....

On server php5 must only transform xml file to xhtml page or PDF file and put a mysqlbasket to order item, one xml file 200Kb can write moore as 1000 webpage on xslt document method....
http://www.w3schools.com/xsl/func_document.asp

I suppose to write all on CGI aplication same as console application ... is a lot of work.... but possibel....

Brandybuck
27th November 2006, 17:10
Yes, it's possible to write CGI program with C++ (and Qt). I wrote one for my last job. CGI programming is essentially string processing, so QString will make the job easier.

jcr
27th November 2006, 17:44
Thanks for sharing the experience. Did you use special CGI libraries? For instance, to handle GET and POST data, to output html, or to manage cookies...?

patrik08
27th November 2006, 18:18
Thanks for sharing the experience. Did you use special CGI libraries? For instance, to handle GET and POST data, to output html, or to manage cookies...?

QHttp make all on network only coffe cant not make.... search "cookie" on this forum... or POST GET or QHttpResponseHeader

jcr
27th November 2006, 22:46
Maybe I don't understand things here but I was under the impression that QHttp handles only the client side of the Http protocol and not the server side. To write a CGI app, I need for instance routines to parse the QUERY_STRING and I don't think it exists in QHttp. As Brandybuck suggested, QString comes in handy at that point but it looks like Qt does not have something specifically tailored for cgi programs.

wysota
28th November 2006, 06:15
Parsing query_string is quite easy if you have QString around. Just split the string around & and then around "=". You can then even construct a QMap that will keep all the arguments.