SyScript http server


In case of problem to display ".spg" files you should install the pluging here

test a short sample here : From a web page

here documentation

         

It is possible to create http server with SyScript.
This server will works as well as IIS server or APACHE server with SyScriptscripts or to display web pages.
click here to see server sources codes
click here to download http server sources codes
In order to test the server on your computer you just have to run http_server.spg file or http_server.spt file
Then, on your browser, you juste have to type the name of your computer, which will display the default parge : HTTP_SRV.html
Here on this sample, HTTP_SRV.html file is the start page of your http server, to be modified by your own
When your server is on the Internet, you just have to type its Internet adress, for example : www.sysdesk.com.

         


To execute a script from the server there are severals possibilities :
- from a standard browser
- from a SyScript script
  The script to execute to the server send to the client the code to execute or a web page to display.
  the sending code runs on memory, no disk access or write.
- from a browser, you can test the sample provided on http_server.zip file, with the web input file : http://server_pcname/script1.spg? or
http://server_pcname/script2.spg?
- from a script (the local server is on my computer)
  CALL http://server_pcname/script1.spg?
or
RUN %APP% http://server_pcname/script1.spg?
or
from a web site "www" (the server is on the internet)
to execute the same sample with modified parameters :
http://server_pcname/script1.spg?param1=var1¶m2=var2
This written is a web standard written
test here online sample : http://www.sysdesk.com/launch_heart.spg?
click here to discover the source code of the test : heart.spt

       

All results of MYSQLQUERY request are stored in a table named MYSQLQUERY
click here to discover heart source code

         


Some of specials caracters needs to be protected in order for the request to works correctly
These can be done with MYSQLESCAPE command, which transforms correctly chains of caracters
;For example, here, the special caracter tobe protected is QUOTE (')
MYSQLESCAPE l'esprit et le vin
SET MAVARIABLE=%MYSQLESCAPE%
MYSQLQUERY SELECT * FROM MaTable WHERE FIELD='%MAVARIABLE%'

It is also possible to modify specials caracters easely, with the special keyword '.MY$'
Please find here an example :
MYSQLQUERY SELECT * FROM MaTable WHERE FIELD='%MAVARIABLE.MY$%'

         


It is possible to store data in binary mode to the database, for example, we can store SyScript
plugins, like ".spg" files. Some of specials caracters needs to be protected in order for the request to works correctly
The BINGET command allows to read a binary file
The VARPROTECT command is used to proctect caracters against any non desire conversion
The command MYSQL UPDATE allows to update existing data
example :
BINGET PATH\file.spg
VARPROTECT #
MYSQLQUERY INSERT INTO `BASENAME`.`TABLENAME`(`id`,`pathname`,`filename`,`file`,`size`) VALUES ('%ID%','%PATHNAME.MY$%','%FILENAME.MY$%','#BINGET.MY$#','%NBINGET%')

         


Database requests can be done through a server (see syscript http server). To ask to SyScript to execute request through
an http server, you just need to input the following command : MYSQLBYHTTP ON,SERVERNAME:PORT_NUMBER
ex : MYSQLBYHTTP ON,MYSERVER:80
All MYSQLQUERY commmands wouldn't be directly executed by the script, but asked to the server to be executed through internet
The server will be in charge to send the request to the internet database over the network
The results of the request will be automaticaly send to the client on MYSQLQUERY table
The best avantage of this methods is to bypass PROXY and FIREWALLS

         


The best avantage to use http server is to request over firewalls
If you directly request a script "http://web_path/script.spg, there is a risk for the request to be blocked by a firewall
which will forbid the execution of an unknown type file. In the same case, if the script made a request on 3306 port for example
the firewall will blocked the request on this unauthorized port
When you use a server, you also use known ports, like 80, and you transit data or request through these ports over the internet
SyScript use standard web syntax for server requests : http://chemin_web/script.spg?param=value
The results of the requests are returned through the initial port to the client which displays the page or the script
If the demand is a MYSQL request, it will be send to MYSQL server by http server. The result will come back from the server
to the client by the same way, in a transparency mode. In the script there is nothing to change on code source
if you put on script the following command : MYSQLBYHTTP ON,"http_syscript_servername":"port_number"
SysDesk application is a client/server application developped with MYSQL database and works on this describe mode
try it on http://www.sysdesk.com

Download trial version of SyScript here

Purchase Now!