View Full Version : thinBasic, like PHP?
Eros, I know we talked about this awhile back, but I couldn't find where. So I decided to ask it again.
If thinBasic is used on a server, would it be like using PHP? How would it work?
I am setting up a test server at home for my old boss to develop ideas. So I thought since I am setting that up, maybe we can experiment with thinBasic and how it can be used?
I remember you had told me that I would need access to the server completely to allow thinBasic server, so in this case it will be so as hosted on as it turns out not a 486, but pentium 100 mhz. I am getting wamp setup on it for my old boss's test site. I can also setup thinBasic if it will work with apache, mysql and php running. I just don't know where thinBasic would fit in, but am anxious to try now that the opportunity here.
ErosOlmi
29-04-2007, 19:03
Yes, it can be used exactly like PHP but we have never used under Apache and never tested MySql connection.
Quite sure you can use MySql if ODBC drivers for MySql are installed. Do not know anything about Apache and how to integrate 3rd party server side script.
We have a test site at http://cgi.thinbasic.com but will implement it in next months.
If you get any result let us know.
Eros
Eros, your link worked and I saw the link for the view source code. Unlike php, you are outputting with echo statements instead of html tags?
Can we output using css style sheets and html as well?
Can you tell me what files I have to put onto my server to test it?
You can use this layout for an example of where things belong:
my main server folder: c:/www
all my apps, like mysql, apache, php are all in as:
c:/www/php
c:/www/mysql
c:/www/apache2
I assume something would go for thinBasic here in the c:/www/thinBasic ?
My server uses this folder to serve from, this where all users go to see my site, they can't or shouldn't be able to access the other areas in www.
c:/www/site/public
If you can tell me using these paths where I should put what, we can see what happens. And troubleshoot from there.
I am running on a windows98 system so I spent all last night installing php4 and mysql 3. something so it works on windows98.
Thanks, exciting to experiment with this stuff!!
Petr Schreiber
30-04-2007, 08:49
Hi kryton,
strings passed as parameter for echo seems to be able to contain HTML, CSS, ... ( in <style></style> tag ) like PHP.
Maybe you are confused there is no code for header / footer of page, but this is hidden in include files.
With configuration I can't help, we should wait till Eros is back :)
Bye,
Petr
RobertoBianchi
30-04-2007, 09:33
Hi Kryton,
Can we output using css style sheets and html as well?
Yes, if you take a look to the Header.tBasic file you'll find both the STYLE.CSS file and the HTML statements.
Can you tell me what files I have to put onto my server to test it?
Try to replicate the same page at http://cgi.thinbasic.com/
You can use this layout for an example of where things belong:
I don't understand if you are talking about APACHE server's settings or ThinBASIC settings?
About ThinBASIC settings did you take a look to the thinBasicCGI.config configuration file at http://www.thinbasic.com/public/products/thinBasic/help/html/index.html ?
Ciao,
Roberto
Thanks Petr and Roberto, I see from the information you provided more information to read up on that will guide me.
Thanks, I will work on it this week and if I can't get it going I will ask some more questions. Thanks for the replies.
Looking through the apache configuration file. PHP support for instance is setup differently than Perl. PHP seems to not be seen as a cgi appliction language, but Perl is. I am assuming then that thinBasic would be setup as Perl is, since in the link above I see CGI in the setup screens for Abyss?
Michael Hartlef
17-08-2010, 09:33
Hi Eros,
I get a 403 error when i try to access that link above.
Cheers
Michael
ErosOlmi
17-08-2010, 09:43
Yes, consider CGI module death till someone will take over it.
Roberto will no more work on it so at the moment priority on it is zero.
If in future there will be some real interest I will try to hand over. Module is quite complex so working on it requires that there will be real interest.
Michael Hartlef
17-08-2010, 12:42
Thanks for the info. Is the current module release usable?
Petr Schreiber
17-08-2010, 12:54
I have been experimenting with CGI about half an year ago, as I did some experiments regarding its use to automate psch.thinBasic.com.
It worked well, as long as you use GET method of passing parameters.
But when I used POST method, CGI_GetQueryValue("name", %CGI_REQUEST_METHOD_POST) did not return anything and Gets() entered the infinite loop on the server.
In my opinion, ThinBASIC, with its string handling, is good candidate for solid PHP alternative, but it would require having person who could dedicate time to maintain the module. Ideally with previous long time CGI experience, which I am not.
Petr
ErosOlmi
17-08-2010, 13:04
Personally I have no problem to publish CGI module as sources but I had no authorization from Roberto to release it to the public so maybe someone else can hand over it.
Unfortunately he just gave to me the authorization to publish as compiled module.
CGI is 100% Roberto module code so I need his OK.
Sorry.
Eros
John Spikowski
17-08-2010, 19:50
While you're waiting for thinBASIC to support CGI, ScrptBasic is a easy way to write CGI scripts. You can use scriba (command line interpreter) or use the ScriptBasic HTTP multithreaded application server. (standalone or as a proxy to Apache) It could be a great way to learn CGI programming without all the work.
Here is an example of using scriba for a Hello World CGI program.
#! /usr/bin/scriba -c
INCLUDE cgi.bas
OPTION cgi$Method cgi::Get
cgi::Header(200, "text/html")
cgi::FinishHeader()
a = "Hello World !"
PRINT """
<html>
<header>
<title>ScriptBasic CGI</title>
</header>
<body>
<center>
"""
PRINT "<h1>" & a & "</h1>\n"
PRINT """
</center>
</body>
</html>
"""
END