Topic Closed
|
PowerBASIC Forums
![]() Source Code
![]() CGI in PBDLL (Putting it all together)
|
| next newest topic | next oldest topic |
| Author | Topic: CGI in PBDLL (Putting it all together) |
|
Paul Dwyer Member |
Okay! This is about 3/4 code from this forum and 1/4 mine but I wanted to know how to do CGI in PBDLL because I'm not a fan of ISAPI. The reason is that for testing you need to keep stopping your web server or if your app crashes or goes into an infinite loop you can't kill it and it trashed your server. The simple reason is that an ISAPI DLL runs in the memory space of the web server itself. Also, There are a lot of CGI bits and pieces on this forum but for those who have put something together an not really had a clue about STDIO (like me) it was very difficult Thank you Jokob and Don for your STD I/O code which is the meat here and I have added a GetPostVal() function to massage the output of the env var. Here is a full working piece with the calling HTML commented at the bottom. Share and Enjoy
------------------ [This message has been edited by Paul Dwyer (edited October 03, 2002).] IP: Logged |
|
Paul Dwyer Member |
Last things to do, Change "+" for " " and I think there is a code snippet here on this forum for changing the %## codes but that's fairly easy too so if I get that done I'll put it all back here as PBCGI.inc ------------------ IP: Logged |
|
Tony A Kirk Member |
Now, is there a way to turn this into a DLL instead of an exe file? That's what I've been looking for and can't find anywhere. Using PB/Win7 of course. -Tony ------------------ IP: Logged |
|
Don Dickinson Member |
quote: Do you mean an isapi dll? if no, the short answer is no. You can do the equivalent thing with an isapi, but the code would not look like this. I think Lothar posted an isapi wrapper/toolkit somewhere on this site. Also, I have isapi headers and wrappers available from my site: dickinson.basicguru.com --Don ------------------ IP: Logged |
|
Paul Dwyer Member |
Get in a quick post before Lance tells us to go to a different forum ![]() Don, Not quite sure what you mean. I don't really like ISAPI much (loved your code though) because it's in process and no convenient for things that need to be updated regularly. But if you wanted to make a CGI.dll with finctions for getting env vars, and having the stdio output etc then just call it from your exe. There is not that much code in this though so I can't really see having a DLL being critical but you could do some customisations and use it for serval apps. Personall I think an INC finle would be better. Or Tony, is this not what you mean? Are you refering to have a code reuse method for the functions or calling the dll directly? ------------------ IP: Logged |
All times are EasternTime (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.