ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to execute my program, setting the environmental variable "CONTENT_LENGTH" to "7", & passing the string, "jazzman" to stdin, manually, in a shell as my test environment.
I think I've managed to set CONTENT_LENGTH to 7 using printenv & export, but I'm not sure how to run my program, passing "jazzman" to stdin via the shell, bypassing my html form (just to test).
Actually, I'm not sure whether this is what you mean Sergei, when you say "test environment."
Okay, my code finally compiles, but when I post to the binary file from an html form saved to the same folder there's a popup that says, "You have chosen to open "schedule_payment" (the name of my binary) which is a: Binary File from: /home/barth/cppexperiments
Would you like to save this file?"
The message simply implies that the webserver does not execute it but passes it straight to the browser. I'm not familiar with this part of webservers, but should that file not be in a cgi directory on a webserver?
should that file not be in a cgi directory on a webserver?
I'm aware that cgi-scripts are always executed from a special cgi-bin on a server, but I'm trying to execute this file as an ordinary program using output from an HTML form. I don't intend to use the final version of this particular program from the web. Is it possible to execute a regular binary file locally by use of input from a local HTML form?
Quote:
Originally Posted by bluegospel:
... Is it possible to execute a regular binary file locally by use of input from a local HTML form?
Yes.
. . . With this in mind, how do I set up my files to act the way I want--to execute my binary rather than trying to open it? What are the implications of the following :
Quote:
The message simply implies that the [system] does not execute it but passes it straight to the browser.
In other words, I want to output the information from the form to my executable, without the use of a server.
I can view html forms in my browser and use its links w/out connecting to a server. Can I also execute a binary program that's not kept on any server (in a cgi-bin), or does that always entail cgi?
Basically I want to write & use small applications using my browser as a user interface, without accessing a server. Is this possible?
...
Basically I want to write & use small applications using my browser as a user interface, without accessing a server. Is this possible?
The very basic idea of WEB browser is to implement secure browsing, which implies no application invoking on client side. The exceptions are Active-X and Java applets, but, AFAIK, they do not write to files.
I think you are becoming vague. And I still do not understand why what you are doing is now implemented in C++. C(++) implementation is necessary for very fast response times, like in stock trading systems.
As to yours, I'm learning C++ because it appears to be used more widely than any other language, and it comes up a lot in discussions about programming; the same reason I'm learning linux.
You're right. I am being vague. Primarily because the material I'm ultimately attempting to learn is both very broad & dense, & also cryptic, including directly working with such protocols as ssl, et. al. (which at the moment are completely enigmatic to me).
Are you suggesting that I use something such as Perl? I like Perl, but the discussions usually come around again to Linux. The Linux discussions usually turn again to C.
...
Are you suggesting that I use something such as Perl? I like Perl, but the discussions usually come around again to Linux. The Linux discussions usually turn again to C.
By the way, what's AFAIK?
AFAIK == "As Far As I Know".
However much I like Perl, the tools should be selected according to the task. If you need text parsing and data structures, Perl is very convenient and pretty fast.
The rule of thumb WRT WEB and C++ is that one needs C++ when response time should be milliseconds.
I didn't quite understand
Quote:
I like Perl, but the discussions usually come around again to Linux
.
Though any known to me Linux distro has Perl installed by default, Perl and Linux are orthogonal in mathematical terms. I.e., for example, there are two well known Perl "packages" for Windows - ActiveState Perl and Strawberry Perl. And, of course, Perl exists for any UNIXish system.
What about very sensitive data, like personal financial information? Can SSL be implemented with just HTML & Perl without big out-of-pocket expenses to such as VeriSign? Can I work directly with different protocols?
-----
Quote:
I didn't quite understand
Quote:
I like Perl, but the discussions usually come around again to Linux
I just meant I'm studying linux because, in my limited use of Perl (on a Windows platform), the discussions quite often refer to linux.
By the way Sergei, thanks for staying with me for so long. I understand it requires perseverance to continue at this basic level for so long as someone very experienced in the subject. I don't take your time for granted.
Last edited by bluegospel; 07-08-2010 at 02:31 PM.
There are lot of tutorials around, so better start with/from basic things and forget about cgi-bin and WEB-specific things for a time being. You have a lot of things to learn without the WEB specifics.
By the way, that first program you've picked from that tutorial is not that C++-ish - it's rather "C" with artificially pulled into it C++ IO.
And you can learn C++ on Windows too, and you do not need MS VC for that - there is MinGW, there is CYGWIN. It's not that I'm recommending Windows, but if you feel more comfortable, then up to you.
As said, better start from basic "C" - without C++.
I don't mean to be overbearing or contradict myself, but my interest in C/C++ is partly curiosity and partly practical, albeit, admittedly, my approach is purely unconventional.
As to the practical, perhaps I should move back towards Perl, but please answer my question addressing ssl and other protocols, because eventually I'm going to need them. Can I experiment first with TCP/IP, eventually moving on to things like SSL, using just HTML & Perl? Otherwise, I'll take your advice and explore C some, although I'm a little worried that some of what I learn will result in bad habits or obsolescence in C++ environments, not knowing what to keep and what to dismiss in C.
I don't mean to be overbearing or contradict myself, but my interest in C/C++ is partly curiosity and partly practical, albeit, admittedly, my approach is purely unconventional.
As to the practical, perhaps I should move back towards Perl, but please answer my question addressing ssl and other protocols, because eventually I'm going to need them. Can I experiment first with TCP/IP, eventually moving on to things like SSL, using just HTML & Perl? Otherwise, I'll take your advice and explore C some, although I'm a little worried that some of what I learn will result in bad habits or obsolescence in C++ environments, not knowing what to keep and what to dismiss in C.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.