Using pascal programs as backend for PHP based webpages? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- BosseB · 2019-12-15 17:12 I have built a Raspberry Pi based data collection system and I have used FreePascal and Lazarus to program its control software running on the RPi. This consists of a few console programs intended to be run by cron. The data are managed inside an SQLite database (for which I have received good help on this forum!) Now I want to build a configuration utility that will be web based (Apache2 on the RPi) and originally I thought that I would use PHP7 and straight HTML coding. But that would mean to somehow re-create the database and other functions I have already developed in Pascal so it would work with PHP... Not so fun. Why web based? Well, it makes it possible to use any computer with a web browser to configure the system when connected to the same network rather than logging on to the RPi itself, which is headless (no monitor or keyboard attached). Question: Is there some simple way to call processing functions written in Pascal from within PHP such that it can retrieve data to display to the user or execute commands and feed back results? All I really want is read and write to the SQLite database and also scan a few directories for certain files, list and down/upload these. Has someone here been there and done that and is willing to share the experience? ---------------------------------------------------------------------- PaulRowntree · 2019-12-15 17:22 Ignorant question coming ...Why do you need the PHP intermediate layer? ---------------------------------------------------------------------- MarkMLl · 2019-12-15 17:23 I'd suggest https://wiki.freepascal.org/CGI_Web_Programming and related pages. I've just set up a very simple webpage on a server run by our ISP which will eventually be a portal to various backend stuff- probably in VMs. They don't support PHP etc but do support CGI, and I wrote a simple script in Perl which expands SSIs in a page passed as the parameter and emits the result. MarkMLl ---------------------------------------------------------------------- bee · 2019-12-15 17:30 You don't need to use PHP to make web apps. Just use Pascal directly, either as CGI, FastCGI, or Apache module. Free Pascal provides fpWeb framework for everything you need to make web apps. I've made lots of web apps using FPC since like 15 years ago. I've never need PHP or nodeJS or any non-Pascal language for that. Now it's even better, Free Pascal has a sister project named pas2js that convert pascal program into javascript. So, you can even write the front-end side using pascal as well. Isn't that awesome? 😊 ---------------------------------------------------------------------- BosseB · 2019-12-15 17:58 Quote from: PaulRowntree on December 15, 2019, 06:22:43 pmIgnorant question coming ...Why do you need the PHP intermediate layer? Because that is the only way I (kind of) know how to use for programming stuff on webpages... There is a way to call an external executable on the webserver from PHP and somehow retrieve the result, I guess. Since I have written a number of related utilities in pascal and compiled for Raspbian they are available to be called. Only I don't really know how to extract the result from them... ---------------------------------------------------------------------- BosseB · 2019-12-15 18:00 Quote from: MarkMLl on December 15, 2019, 06:23:29 pmI'd suggest https://wiki.freepascal.org/CGI_Web_Programming and related pages. I've just set up a very simple webpage on a server run by our ISP which will eventually be a portal to various backend stuff- probably in VMs. They don't support PHP etc but do support CGI, and I wrote a simple script in Perl which expands SSIs in a page passed as the parameter and emits the result. MarkMLl Hi Mark, I will have a look at that documentation. Thanks. ---------------------------------------------------------------------- BosseB · 2019-12-15 18:03 Quote from: bee on December 15, 2019, 06:30:42 pmYou don't need to use PHP to make web apps. Just use Pascal directly, either as CGI, FastCGI, or Apache module. Free Pascal provides fpWeb framework for everything you need to make web apps. I've made lots of web apps using FPC since like 15 years ago. I've never need PHP or nodeJS or any non- Pascal language for that. Now it's even better, Free Pascal has a sister project named pas2js that convert pascal program into javascript. So, you can even write the front-end side using pascal as well. Isn't that awesome? 😊 First off, I am an old hand so I do not know much about "webapps", what are these? Do you mean one can use the Lazarus desktop programming and somehow show the programs through a web server? Regarding Javascript I am totally unfamiliar with Java so I'd rather stay away from that. Started using Pascal back in the 1980-es, though. ---------------------------------------------------------------------- MarkMLl · 2019-12-15 18:06 Bo, first step: find out what scripting etc. facilities are supported by your webserver. Second step: do not under any circumstances be tempted to write your own custom webserver. MarkMLl ---------------------------------------------------------------------- lainz · 2019-12-15 19:14 Quote from: BosseB on December 15, 2019, 07:03:49 pmRegarding Javascript I am totally unfamiliar with Java so I'd rather stay away from that. Started using Pascal back in the 1980-es, though. Javascript is not Java. ---------------------------------------------------------------------- BosseB · 2019-12-15 20:20 I now looked (briefly) at the links provided and it seems like a webapp is more or less an invisible processing system. The examples I looked at looked mostly like "Hello world" type programs operating in a console. But I need a GUI configuration form where I can enter or select values and then submit them to a web server handler. For me this has always been a php file receiving the data and then doing something with them. In the current case I want to check the validity of the data and store in the database or maybe trigger some server side action. Also on request from the user retrieve result data as files or display. This would be PHP code calling pascal programs for retrieval and then rendering the result into a GUI form sent back to the user. Rather than programming these database and file system operations in PHP my thought was to use PHP to extract the input data from the user (form submission) and then repackage these into a call to my pascal program that does the real work towards the database and hardware.... ---------------------------------------------------------------------- MarkMLl · 2019-12-15 20:31 As I said, you start off by finding out what facilities your web server (Apache?) is configured to provide. It might even have PHP. Any HTML page- without Javascript and potentially without CSS- has a basic set of interactive data entry components. Even without PHP etc., CSS allows you to make components visible/invisible depending on what else is going on. Javascript is vastly overused in my opinion, mainly by addons which benefit their writer more than the user (e.g. targetted advertising under the control of Google et al.). But detailed discussion is way off topic. MarkMLl ---------------------------------------------------------------------- lucamar · 2019-12-15 20:36 Quote from: BosseB on December 15, 2019, 09:20:20 pmRather than programming these database and file system operations in PHP my thought was to use PHP to extract the input data from the user (form submission) and then repackage these into a call to my pascal program that does the real work towards the database and hardware.... It depends heavily on what you're currently doing (if anything) and what your final goal is but if I were you I would forget about PHP and let my Pascal program manage everything. That way you can avoid most (if not all) problems of interoperabilrity between the two programs. Whether the backend is CGI/FastCGI, an Apache module or whatever I'm fairly sure it can be done in Pascal without more than the normal problems. ---------------------------------------------------------------------- BosseB · 2019-12-15 21:30 Quote from: MarkMLl on December 15, 2019, 09:31:09 pmAs I said, you start off by finding out what facilities your web server (Apache?) is configured to provide. It might even have PHP. As I think I have mentioned but possibly in another thread the target for my system is a Raspberry Pi running Raspbian Buster and with Apache2 + PHP etc installed. Not MySql though, I decided against its complications and am using an SQLite database instead. The web interface is not a user interface as such, it is just a front end to set up (configure) the system and define the automatic tasks to execute. In order to use it one has to be physically connected to the RPi network.QuoteAny HTML page- without Javascript and potentially without CSS- has a basic set of interactive data entry components. Even without PHP etc., CSS allows you to make components visible/invisible depending on what else is going on.Yes, I have designed a prototype webpage in php lingo that shows the boxes, lists and selectors I need. It works ok right now but it does not do anything of course. I think I will just use the PHP exec() function with my own pascal programs and get it done.... Of course I will have to create the php webpages also, but it should not be a big deal. And I already know the way to extract the posted data from the form so I can stuff it onto a call to my pascal program. Will do some experimentation shortly. ---------------------------------------------------------------------- bee · 2019-12-16 01:50 It seems Bosse doesn't have proper knowledge about web apps nor web pages. I wrote a tutorial about that, but unfortunately it's written in Bahasa Indonesia not English, because it's for my fellow Pascal programmers in Indonesia. The tutorial explains from the very basic of HTTP, HTML, CSS, JavaScript, scripting, web server features (based on Apache), communication between web server and our program (in Pascal), etc. PHP is just ONE of MANY ways to make a web apps. There are many other better ways than using PHP for web apps. Web apps are like desktop app but using web interface (instead of GUI or CLI). So, instead using OS GUI APIs to display things to user, it's using HTML and CSS and using Javascript to make to do the logic (on the browser side). Oh, Javascript is NOT Java. Basically, a web app starts from a browser request to your web server. Your web server should know the URL requested is handled by other application. Your web server forward the request to the application handler which is your pascal program. Your program then reads the input given by your web server (using either CGI, FastCGI, or Apache module). The easiest way is using CGI since all you need to do is read input from standard input and send output to standard output. Your program response to your web server request by sending output in HTML document along with the required CSS and Javascript code (either internal or external to the HTML document). Your web server reads your response and forward it to the browser that requested at the beginning. That's what happened in every single request and response of HTTP communication. Some people think that the application part (the program that you wrote to handle web server request) can only be written in PHP. It's very wrong. You can even write it in bash script or batch file. There's nothing that PHP can do and other language can't. My first web app was written in Turbo Pasal 5.5. ---------------------------------------------------------------------- bee · 2019-12-16 01:55 Along with the tutorial, I also made a WebCRT unit to demonstrate how easy it's to write web apps using Pascal and the unit. It's almost as easy as using the standard CRT unit. For more control but with more "manual" way, you may use my webUtils unit, like to handle sessions and cookies. The repo contains the codes of my web app tutorial. I think you can learn something from them although you don't read the tutorial. Hope it will help. ---------------------------------------------------------------------- valdir.marcos · 2019-12-16 05:03 Quote from: bee on December 16, 2019, 02:55:00 amAlong with the tutorial, I also made a WebCRT unit to demonstrate how easy it's to write web apps using Pascal and the unit. It's almost as easy as using the standard CRT unit. For more control but with more "manual" way, you may use my webUtils unit, like to handle sessions and cookies. The repo contains the codes of my web app tutorial. I think you can learn something from them although you don't read the tutorial. Hope it will help.Impressive. Thanks for sharing. ---------------------------------------------------------------------- avra · 2019-12-16 07:59 You can simply add JsonRPC to your application and expose some of it's functionality to 3rd parties. If you browse fpc sources you will find some examples. There is also CeosMW JSONRPC which can be downloaded via OPM or through https://github.com/jbsolucoes/ceosmw. CeosMW components make this task very easy. ---------------------------------------------------------------------- PascalDragon · 2019-12-16 08:05 Quote from: BosseB on December 15, 2019, 09:20:20 pmBut I need a GUI configuration form where I can enter or select values and then submit them to a web server handler. For me this has always been a php file receiving the data and then doing something with them. PHP essentially boils down to reacting to a HTTP request (e.g. GET index.php) by sending a HTTP response to the client which (in most cases) will simply be HTML text. That is nothing special of PHP and can just as easily be down with FPC (or any other language in fact). ---------------------------------------------------------------------- MarkMLl · 2019-12-16 08:19 Quote from: bee on December 16, 2019, 02:50:28 amSome people think that the application part (the program that you wrote to handle web server request) can only be written in PHP. It's very wrong. You can even write it in bash script or batch file. There's nothing that PHP can do and other language can't. My first web app was written in Turbo Pasal 5.5. The crucially important thing is that the web server should have a mechanism to pass a request for certain content to custom code. That custom code could be PHP, SSI (in the original page), CGI (a script in a separate directory), or a server-specific mechanism to improve the efficiency of any of those (e.g. Apache's ModPerl, which eliminates the overhead of a load/compile every time a script is run). MarkMLl ---------------------------------------------------------------------- BosseB · 2019-12-16 10:36 Quote from: bee on December 16, 2019, 02:50:28 amIt seems Bosse doesn't have proper knowledge about web apps nor web pages. You are quite right about that concerning "Web apps"! It is the main reason I am asking here... Web pages in general I do know, I have written sites since the 1990:es using just a text editor...Quote I wrote a tutorial about that, but unfortunately it's written in Bahasa Indonesia not English, because it's for my fellow Pascal programmers in Indonesia. The tutorial explains from the very basic of HTTP, HTML, CSS, JavaScript, scripting, web server features (based on Apache), communication between web server and our program (in Pascal), etc. Maybe I can try sending it through Google Translate? QuotePHP is just ONE of MANY ways to make a web apps. There are many other better ways than using PHP for web apps. Web apps are like desktop app but using web interface (instead of GUI or CLI). So, instead using OS GUI APIs to display things to user, it's using HTML and CSS and using Javascript to make to do the logic (on the browser side). Oh, Javascript is NOT Java. I looked at your example and realized that: 1) One can use a straight pascal cli program to handle the POST or GET call. 2) One just has to place the program into the cgi-bin dir of the webserver and set its name as the form handler 3) One builds the response page as html in pascal code and put return variable values into that then writes it out as a writeln So I should be able to do this in my command line programs written with Lazarus! QuoteThe easiest way is using CGI since all you need to do is read input from standard input and send output to standard output. Your program response to your web server request by sending output in HTML document along with the required CSS and Javascript code (either internal or external to the HTML document). Your web server reads your response and forward it to the browser that requested at the beginning. That's what happened in every single request and response of HTTP communication. Some people think that the application part (the program that you wrote to handle web server request) can only be written in PHP. It's very wrong. You can even write it in bash script or batch file. There's nothing that PHP can do and other language can't. My first web app was written in Turbo Pasal 5.5. Very helpful response! Thank you very much! I have a few clarification questions: 1) Displaying the main form using a pascal program? Since I am using web forms for my configuration and status pages it would be better if I can synchronize the web form and processing inside the pascal program by having the actual page display also controlled by the pascal code. One less thing to get out of sync.... So can I display my config using an url such as this: Code: [Select]http://rpimonitor/cgi-bin/mainpageWhere mainpage is my pascal program for showing the main page... Or maybe cgi-bin is not directly available on the browser (I think it is typically located above the document root) so I may need an index.php file on the server that calls the cgi-bin script? If so how would that be done? 2) Form handler type GET and POST? The two types I know of are POST and GET where the submit button will in the GET case put the input data into the URL itself whereas in the POST case the data is sent in another way, which I don't know how... When dealing with form handlers there are different ways to deal with that in PHP, how does it work in cgi pascal programs? Say I use the POST method in the form, how do the data arrive into the pascal cmd line program? Grateful for your input!" ---------------------------------------------------------------------- MarkMLl · 2019-12-16 10:54 Quote from: BosseB on December 16, 2019, 11:36:03 amI looked at your example and realized that: 1) One can use a straight pascal cli program to handle the POST or GET call. 2) One just has to place the program into the cgi-bin dir of the webserver and set its name as the form handler 3) One builds the response page as html in pascal code and put return variable values into that then writes it out as a writeln So I should be able to do this in my command line programs written with Lazarus! That's right. But you'll need to look at the CGI environment variables that are made available to your script, and different servers make different one available. > Or maybe cgi-bin is not directly available on the browser (I think it is > typically located above the document root) so I may need an index.php > file on the server that calls the cgi-bin script? If so how would that be done? Note that cgi-bin is entirely a server-side thing. On the browser you've got Javascript (disabled to varying extents by security addons), and very rarely you might come across Java, ActiveX and so on. > 2) Form handler type GET and POST? One pipes the submission, the other encodes it in the URI. There have also been various server-specific methods in the past, e.g. PATCH, but those are rarely implemented these days. MarkMLl ---------------------------------------------------------------------- BosseB · 2019-12-16 11:32 I found this Apache tutorial concerning CGI and its various aspects... So I think I am on the right way now. I believe that my compiled pascal program will work if it is placed in a dir, which has been marked in the apache conf file using the directive ScriptAlias. I will check that as soon as I have an example program to test with. Seems like the input data are available like this: POST: on STDIN as a string like name=value&name2=value&name3=value GET: in an environment variable QUERY_STRINGS in the same format as above ---------------------------------------------------------------------- MarkMLl · 2019-12-16 11:46 On a standard Debian system I found that Apache was configured to expect CGIs in /usr/lib/cgi-bin and that provided I set up a symlink it worked fine; I'd be surprised if Raspbian were different. I ended up with /var/www/html/cgi-bin which isn't quite the classic layout but if it works... BE TOLD: treat QUERY_STRINGS and the rest with caution. I think that one's fairly universally implemented, but there are others relating to referring document etc. which you'll need and are somewhat variable. MarkMLl ---------------------------------------------------------------------- bee · 2019-12-16 16:16 Quote from: BosseB on December 16, 2019, 11:36:03 amMaybe I can try sending it through Google Translate? If you're so interested, you may get my free mini ebook about web programming using (Free)Pascal here (it's a 2.2 MB PDF file). And the code of the examples of the book are here. Quote from: BosseB on December 16, 2019, 11:36:03 amI looked at your example and realized that: 1) One can use a straight pascal cli program to handle the POST or GET call. 2) One just has to place the program into the cgi-bin dir of the webserver and set its name as the form handler 3) One builds the response page as html in pascal code and put return variable values into that then writes it out as a writeln So I should be able to do this in my command line programs written with Lazarus! Indeed! Quote from: BosseB on December 16, 2019, 11:36:03 amVery helpful response! Thank you very much! You're welcome. I'm glad to be able to help you. Quote from: BosseB on December 16, 2019, 11:36:03 amI have a few clarification questions: 1) Displaying the main form using a pascal program? Since I am using web forms for my configuration and status pages it would be better if I can synchronize the web form and processing inside the pascal program by having the actual page display also controlled by the pascal code. One less thing to get out of sync.... So can I display my config using an url such as this: http://rpimonitor/cgi-bin/mainpage Where mainpage is my pascal program for showing the main page… The main page of your program is the output of the program itself. If your mainpage[.cgi] produce correct HTML document along with the required CSS and JS files, then the client browser will render it to the user like a normal web page. Quote from: BosseB on December 16, 2019, 11:36:03 amOr maybe cgi-bin is not directly available on the browser (I think it is typically located above the document root) so I may need an index.php file on the server that calls the cgi-bin script? If so how would that be done? The cgi-bin folder is configurable. It's the folder that specially set for F/CGI binary files, by default. Of course you may change it to any folder. Just study the Apache setting for executable binary files. Quote from: BosseB on December 16, 2019, 11:36:03 am2) Form handler type GET and POST? The two types I know of are POST and GET where the submit button will in the GET case put the input data into the URL itself whereas in the POST case the data is sent in another way, which I don't know how… When dealing with form handlers there are different ways to deal with that in PHP, how does it work in cgi pascal programs? Say I use the POST method in the form, how do the data arrive into the pascal cmd line program? Very simple actually. Every GET variables and its value will be stored in an environment variable named QUERY_STRING, you can use the GetEnvironmentVariable() function to read the content. And POST variables and its values streamed into standard input, you simply use the standard readln procedure to get the content. Or, you better study my tutorial and read the examples. Good luck! ---------------------------------------------------------------------- MarkMLl · 2019-12-16 17:30 Quote from: bee on December 16, 2019, 05:16:19 pmThe main page of your program is the output of the program itself. If your mainpage[.cgi] produce correct HTML document along with the required CSS and JS files, then the client browser will render it to the user like a normal web page. Or the main page can be a frameset, with at least some of the constituent frames being generated by CGI. That has the advantage that the scripts can look at the referrer and have some degree of confidence that they're not being fed malicious parameters, rather than letting a potentially-untrusted user drive the scripts directly. MarkMLl ---------------------------------------------------------------------- zamronypj · 2019-12-17 05:57 Quote from: BosseB on December 15, 2019, 06:12:16 pm Question: Is there some simple way to call processing functions written in Pascal from within PHP such that it can retrieve data to display to the user or execute commands and feed back results? All I really want is read and write to the SQLite database and also scan a few directories for certain files, list and down/upload these. Has someone here been there and done that and is willing to share the experience? mixing Pascal with PHP is actually hard. You need to export functionality written in Pascal as library (as shared object *.so).create PHP extension so that library function can be invoked from PHP code.Enable that extension Writing PHP extension requires you to use C language or Zephir language. I do not know if Free Pascal can be used to write PHP extension. (maybe Free Pascal can but, AFAIK, no PHP headers are converted yet) So the simplest way is just to use Pascal or PHP. PHP can access SQLite database as well as Free Pascal. ---------------------------------------------------------------------- egsuh · 2019-12-17 06:47 Once you have web-server program, then you may use Lazarus program (I mean Windows visual program if the terminals are running on Windows --- I do not know about Linux) using Synapse... You don't have to bother write HTML (and CSS, JS, etc.). ---------------------------------------------------------------------- avra · 2019-12-17 07:31 Quote from: zamronypj on December 17, 2019, 06:57:32 ammixing Pascal with PHP is actually hard. Not if you use JsonRPC on Pascal side (like CeosMW), and JsonRPC on PHP side (like https://github.com/datto/php- json-rpc). ---------------------------------------------------------------------- PascalDragon · 2019-12-17 08:23 Quote from: BosseB on December 16, 2019, 11:36:03 amI looked at your example and realized that: 1) One can use a straight pascal cli program to handle the POST or GET call. 2) One just has to place the program into the cgi-bin dir of the webserver and set its name as the form handler 3) One builds the response page as html in pascal code and put return variable values into that then writes it out as a writeln So I should be able to do this in my command line programs written with Lazarus! You can also take a look at fpWeb which is part of FPC and Lazarus and would deal with all the background stuff of request variables, headers, etc. You can find an example for CGI here. Please note that you do not need to use Lazarus for this. You can just as well use fpWeb inside a "command line" application. ---------------------------------------------------------------------- BosseB · 2019-12-17 10:34 Quote from: PascalDragon on December 17, 2019, 09:23:18 amQuote from: BosseB on December 16, 2019, 11:36:03 amI looked at your example and realized that: 1) One can use a straight pascal cli program to handle the POST or GET call. 2) One just has to place the program into the cgi-bin dir of the webserver and set its name as the form handler 3) One builds the response page as html in pascal code and put return variable values into that then writes it out as a writeln So I should be able to do this in my command line programs written with Lazarus! You can also take a look at fpWeb which is part of FPC and Lazarus and would deal with all the background stuff of request variables, headers, etc. You can find an example for CGI here. Please note that you do not need to use Lazarus for this. You can just as well use fpWeb inside a "command line" application. When I am referring to Lazarus I am just indicating my use of it as a development IDE. The actual programs are just non-visual command line programs communicationg via start arguments, environment variables and STDIO interchanges. Meant to run on an RPi without anyone logged on and no display or keyboard attached. Also the RPi will be interfaced this way only for configuration by a single user and once that is done it will be on its own... And I have scrapped the idea of using PHP in favour of directly calling the pascal programs from Apache. So the subject of this therad is now a bit misleading.... ---------------------------------------------------------------------- mr-highball · 2019-12-17 14:59 I wrote some microservices that handled requests to/from a sqlite db a little while back, and it used the standalone web framework that comes with fpc (which makes it incredibly easy to deploy). Here's the repos, https://github.com/mr-highball/dcl-hackathon-2019 (initial repo with some implemented services) https://github.com/mr-highball/dcl-microservices (trimmed up repo with only core stuff) This is an example web service which was successfully built/deployed on a linux droplet running with digital ocean (so cross compiling to pi should work no prob). It takes image url's and dithers them down to a reduced color space, and offers endpoints to fetch the result from a sqlite db. https://github.com/mr-highball/dcl- hackathon-2019/tree/master/services/image-service here's some examples of an endpoint being used to return some content to the user, https://github.com/mr-highball/dcl- hackathon-2019/blob/master/services/image- service/src/controller.status.pas#L146 https://github.com/mr-highball/dcl- hackathon-2019/blob/master/services/image- service/src/controller.registration.pas#L549 some niceties that you get if you use the stuff I wrote would be the automatic execution/serialization of db calls that contain result sets, https://github.com/mr-highball/dcl- hackathon-2019/blob/master/services/image- service/src/controller.status.pas#L253 While the use case is not probably close to what you're doing, the code may help point you in the right direction. By no means is this the only way to do things, just hoping it may help ---------------------------------------------------------------------- BosseB · 2019-12-17 18:55 I am sorry to have to come back here after I thought I had it all fixed.... I have created a getwebpage program in FPC and what it does is that it will output a webpage built internally by writing it out STDOUT when executed. The content depends on how it is called: - if the env variable QUERY_STRING is present it will read that and parse it (case GET) - if there is a command line argument it will read this and parse it (case POST) - if there is no data of any of the two kinds it will output an error page. In the two first cases the output is a web page source with preamble, head with style section, body and the end tags. Preamble is the Mime header "Content-type: text/html" Body is the decoded data from the input. I have verified the creation of the webpage by setting up the env variable with the type of data from a GET operation and when I run this from the command line and send the output into a file it contains the exact expected content. But when I call this from a web browser via Apache CGI handling I am always getting error 500 and the Apache error log says this: Code: [Select][Tue Dec 17 19:18:04.837217 2019] [cgi:error] [pid 24911] [client 192.168.119.166:58361] malformed header from script 'getwebpage': Bad header: The data sent out from the program looks like this: Code: [Select]Content-type: text/html
Got Data:
namn=Olle
trafik=hemsk
Test=7
Got Data:
namn=Olle
trafik=hemsk
Test=7