Relative Content

Common Gateway Interface (CGI) in c++

category

Javascript navigation and form data.

One of the things that I found myself doing over and over again was creating a function to post data back to the server so I created a tiny class that makes use of my jsfunction class to simplify the creation of post functions. #include “jsnav.h” using std::string; using std::vector; jsnav::jsnav(std::string fName) : jsfunction(build_function_name(fName)) { […]

Javascript in c++

The problem that I had with laying down javascript functions in c++ was very similar in nature to the problem one of html; i.e. having escape characters all over the place or producing virtually unreadable code.  Thankfully the problem was much easier to solve with a class of less than 100 lines of code; And […]

Formatted html – example usage (pt.3)

If you want to use this class then you will need 2 files (the header and cpp files).  Please note that there is no error checking or logging in these examples and if you are using them in a production environment then you will need to add your own, but you should be able to […]

Formatted html – pretty_html (pt.2)

Once we have built our node tree we need some way to parse it in order to produce a pretty html formatted page.  When I was developing this it took way to much thinking time for the number of lines of code, but there are literally 2 functions that we use, and out of them, […]

Formatted html – html_tree (pt.1)

There is a good, if somewhat basic tutorial available at tutorialspoint here: https://www.tutorialspoint.com/cplusplus/cpp_web_programming.htm so if you know nothing of using cgi then this is a good starting point.  While cgicc works pretty well, debugging can be a bit of a nightmare unless you format your code to make it readable. Please note:  This is reference […]