Source language: Translate to:

NeoBook as CGI program?

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

Moderator: Neosoft Support

NeoBook as CGI program?

Postby David de Argentina » Thu Jun 01, 2017 4:01 pm

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.
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: NeoBook as CGI program?

Postby David de Argentina » Fri Jun 02, 2017 8:44 am

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

Image

Another 0.01
David de Argentina
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: NeoBook as CGI program?

Postby David de Argentina » Fri Jun 02, 2017 3:36 pm

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
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: NeoBook as CGI program?

Postby HPW » Fri Jun 02, 2017 10:05 pm

Yes, now visible.
Hans-Peter
User avatar
HPW
 
Posts: 2518
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: NeoBook as CGI program?

Postby virger » Sat Jun 03, 2017 7:24 pm

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
User avatar
virger
 
Posts: 518
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: NeoBook as CGI program?

Postby David de Argentina » Thu Jun 08, 2017 10:50 am

Hi Virger,

Here is the EXE:

http://specialapps.rcmediaservices.net/files/WebCamServer.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
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: NeoBook as CGI program?

Postby David de Argentina » Thu Jun 08, 2017 11:01 am

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

Image
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: NeoBook as CGI program?

Postby Neosoft Support » Thu Jun 08, 2017 5:30 pm

Wow! That's really interesting.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: NeoBook as CGI program?

Postby David de Argentina » Thu Jun 08, 2017 7:49 pm

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
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: NeoBook as CGI program?

Postby dpayer » Mon Jun 12, 2017 8:25 am

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
User avatar
dpayer
 
Posts: 1382
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NeoBook as CGI program?

Postby David de Argentina » Tue Jun 13, 2017 9:41 am

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
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to NeoBook and the Internet

Who is online

Users browsing this forum: No registered users and 1 guest