|
Post by meerkat on Feb 9, 2023 4:06:53 GMT -5
I'm new to LB and am trying to do web applications. So this is probably something everyone is already doing. Has anyone done web applications with LB? Is it possible to use CGI with LB? I have WAMP server running. Can I use that? Does LB have stdio? Is thate a dll I can use for CGI?
Thanks for the help.
|
|
|
Post by tsh73 on Feb 9, 2023 8:40:07 GMT -5
>> Does LB have stdio? No I've seen something posted on this forum - dll? - that said it *adds* stdio. But I did not tried it / cannot find it any more. really IMHO but LB is not designed for that (well, RB does his own server instead) so while it coud be possible, better return of investmenf would be pick up more suitable language. Preferably one with CGI library existing (reinventing wheels is fun for some limit, then it is a chore) (though CGI probably considered bronze age now).
EDIT while I did not found that I mentioned, I got this thread libertybasiccom.proboards.com/thread/901/suggestion-standardized-professional-looking-appsthere Chris Iverson says something on LB, CGI and Apache. Oh man. I see you was in the thread.
I finally found that thread libertybasiccom.proboards.com/thread/2184/console-lbIndeed it says "console", not "stdin".
|
|
|
Post by meerkat on Feb 9, 2023 9:01:02 GMT -5
Hmmmm! I remember that discussion years ago.. Haven't been back here in a while. Looks like not much has changed or added to do client/server. A language IMHO does not have to be built specifically to do web apps. All it needs is a interface. Most BASIC languages out there have a client/server method of some kind. I think I'll look around again for a BASIC language with client/server. I used to use RB but it hasn't had updates/fixes in years, so I can no longer use it. I was looking at using another BASIC to do CGI and have it call LB. But then that is kinda crazy..
Thanks for the update..
|
|
|
Post by Rod on Feb 9, 2023 10:00:31 GMT -5
Brent posted some code a while ago on the LBPE, he also has his own forum Bay6 vivifier. It uses wininet.dll. Have a google it might be the .dll you are after. Very little other code but it might be a start.
CODE BEGINS 'Retrieving HTTPS Data Demo 'By Brent D. Thorn, 9/2005 remoteFile$ = "https://login.yahoo.com/" CHUNK.SIZE = 512 ' enough bytes to hold a single line of HTML Open "wininet" For DLL As #inet 'It would be a good idea to test for an Internet 'connection before proceding. This demo assumes 'you have one already. ' Register a new user agent. Use proxy settings ' set up in Internet Options Control Panel. CallDLL #inet, "InternetOpenA", _ "My User Agent" As Ptr, _ 0 As Long, _ 'INTERNET_OPEN_TYPE_PRECONFIG _NULL As Long, _ _NULL As Long, _ 0 As ULong, _ hInet As ULong If hInet = 0 Then [ErrExit] ' Open a request to a remote file CallDLL #inet, "InternetOpenUrlA", _ hInet As ULong, _ remoteFile$ As Ptr, _ _NULL As Long, _ 0 As Long, _ 2147483648 As ULong, _ 'INTERNET_FLAG_RELOAD _NULL As Long, _ hFile As ULong If hFile = 0 Then [ErrExit] ' Start reading in the file by chunks. Buffer$ = "" chunk$ = Space$(CHUNK.SIZE)+Chr$(0) Struct pdw, NumberOfBytesRead As ULong Do CallDLL #inet, "InternetReadFile", _ hFile As ULong, _ chunk$ As Ptr, _ CHUNK.SIZE As ULong, _ pdw As Struct, _ ret As Long If pdw.NumberOfBytesRead.struct = 0 Then Exit Do Buffer$ = Buffer$ + Left$(chunk$, pdw.NumberOfBytesRead.struct) Loop Until 0 Print Buffer$ [ErrExit] ' If you get an error, find GetLastError on MSDN. There ' you will find a link to a list of error codes. CallDLL #kernel32, "GetLastError", ret As ULong If ret Then Print "Error ";ret ' Free the handles we created and exit. If hFile Then _ CallDLL #inet, "InternetCloseHandle", _ hFile As ULong, ret As Long If hInet Then _ CallDLL #inet, "InternetCloseHandle", _ hInet As ULong, ret As Long ' Strangely, the next line causes LB to hang for around 45 ' seconds on my computer, a 2.2 GHz running XP on dial-up. Close #inet End 'CODE ENDS
|
|
|
Post by meerkat on Feb 9, 2023 10:27:41 GMT -5
Thanks Rod.. I'll look into it.
Using the LB generator submited on this forum, I generated some LB code to list table pages that also did add, change, and delete. I converted the code to FreeBasic and to use mySQL instead of SQLite and it worked using Apache and CGI. I like their web interface. Maybe there is something there that can be brought over to LB. I'll keep looking and comparing.
|
|