I make sure i use binary transfer type when i upload the binary file to the server.
I then set the permissions for it to 755
With the interpreter on the server all i have to do is upload two files in order to run scripts that display in the browser.
1st file:
I use a perl cgi script to run the source code.
note: I set the server to recognize files with the extension .fbs as executable cgi files.
note: the cgi file is not really executing (it's just a text file), which opens a shell (a command prompt) to run my executable interpreter.
I saved this code as hello_world.fbs
Code: Select all
#!/usr/bin/perl
print "Content-type: text/html\n\n";
system("./fbs hello_world.bas");
And this code as hellow_world.bas
Code: Select all
Dim As Integer i
Dim As String s,temp
For i = 1 To 10
temp = "<h1>" + Str(i) + ". Hello World</h1>"
s+=temp
Next
Print s
Sleep
Make sure to use TRANSFER TYPE ASCII
Next I set the file permissions to 755 for hello_world.fbs
note: no need to set the permissions to your bas file.
And finally I test it using a browser
http://fbcadcam.org/fbs/hello_world.fbs