NeoBook as CGI program?

Questions and information about creating Internet aware NeoBook applications. Including PHP, HTML, FTP, HTTP, Email, etc.

Moderator: Neosoft Support

Locked
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

NeoBook as CGI program?

Post by David de Argentina »

Hi overthere,

I think this scenario:

* Your domestic pc has a dynamic IP
* You did not installed a web server in this pc.
* You would like run several NeoBook programs from another computers (or phones)

Long time ago, i found a Powerbasic program with a minimal version of a webserver (all we need in 44 kb!!!).
When running, the path of the program is the root of the server

I tested this trying to run a NeoBook program, like a CGI one.
Obviously, the NeoBook program is non-interactive, because it runs into the server (bah, your machine...)

In this sample, i read a recordset from a sqlite database (could be anything any idea) and response from the webserver the recordset.

the result image (from my phone, running Mozilla Firefox) is:

Image

If you wanna more info, tell me about this.

My 0.01
David de Argentina
Last edited by David de Argentina on Fri Jun 02, 2017 3:30 pm, edited 1 time in total.
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: NeoBook as CGI program?

Post by David de Argentina »

Same program using the external IP and Opera Browser on my Phone (Android):

Image

Another 0.01
David de Argentina
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: NeoBook as CGI program?

Post by David de Argentina »

Hi overthere,

An user told me the previous images are not showing.

I just moved them to another server.

Could any tell me if the images are now visible ?

Thanks in advance,
David de Argentina
User avatar
HPW
Posts: 2571
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany
Contact:

Re: NeoBook as CGI program?

Post by HPW »

Yes, now visible.
Hans-Peter
User avatar
virger
Posts: 540
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: NeoBook as CGI program?

Post by virger »

Tienes el '.bas' o bien el '.exe' de esa app?. Me interesaria una copia. Muy agradecido.
Do you have the '.bas' or '.exe' for that app? I'd be interested in a copy. Very thankful.

KEYLOR NAVAS es de COSTA RICA
COSTA RICA
PURA VIDA
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: NeoBook as CGI program?

Post by David de Argentina »

Hi Virger,

Here is the EXE:

http://specialapps.rcmediaservices.net/ ... Server.zip

The default path is the webcamserver.exe path.
The default open file is default.htm

At the remote client (phone, tablet, etc) you can write an URL that calls your NeoBook EXE program, like:

192.168.1.12/MiProgram.exe

or

MyExternalIP/MiProgram.exe

if you know remotelly the server esternal IP.
Use dynu services to get an URL for a dynamic IP. Works fine.


If your neobook program generates a response, it may be wrote in a "temp.htm" file, like:

FileWrite "temp.htm" "All" "Everything is OK"
or
FileWrite "temp.htm" "All" "[result_data]"

Enjoy it!
David de Argentina
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: NeoBook as CGI program?

Post by David de Argentina »

Same program called from Opera browser at Android device using the External (dynu linked) IP:

Image
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: NeoBook as CGI program?

Post by Neosoft Support »

Wow! That's really interesting.
NeoSoft Support
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: NeoBook as CGI program?

Post by David de Argentina »

Thanks Dave,

It's very interesting really...

If you run (on any device) this url:

http://aplicaciones.dynu.com/recordset.exe

you could get the NeoBook program working.



I'm working on a new version that allow send parameters.

At NeoBook side, Commandline action should do the work, but nothing happens

At Powerbasic side (the webserver program) main problem is when webserver launch the action, in this case, the NeoBook program.

Perhaps i will need some help in this theme.

Greetings from Buenos Aires,
David de Argentina
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NeoBook as CGI program?

Post by dpayer »

David de Argentina wrote:Thanks Dave,
It's very interesting really...
I'm working on a new version that allow send parameters.
At NeoBook side, Commandline action should do the work, but nothing happens
Perhaps i will need some help in this theme.
David de Argentina
David,

Perhaps a safer way than launching an executable via the webserver (imagine if someone finds a way to launch format.exe) would be to use a database as the means to exchange information with NB.

You can have NB monitor a table for changes. When an entry is made you could have NB verify the request from a catalogue of acceptable responses or run a subroutine with data provided in a form that makes an entry in the table.

In this case the DB is an intermediary and you should be able to control what actions are done based on the content of specific columns in the record.

Using this method, NB could be used to monitor existing applications (content management / databases / form responses, etc) and make existing data useful in ways not imagined by the developer of that app.
David Payer
Des Moines, Iowa
USA
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: NeoBook as CGI program?

Post by David de Argentina »

Hi DavidP,

Totally agree.

In order for this to be possible, it is necessary to be able to pass a parameter informing what is wanted to be done.

There is something strange about the way PowerBasic handles its own RUN function, which causes the parameter to be misinterpreted.

When I have some progress, I will let you know.

Regards,
David de Argentina
Locked