|
com.comsoltech.CGI 1.0
What is
com.comsoltech.CGI 1.0?
com.comsoltech.CGI components let you use instead of Request Object (ASP built-in
object) which you can read and modify the content of the parameters passed via
GET or POST. This
is similar to Perl's CGI.pm module.
Installation
A Windows Scripting Component (scriptlet) can be instantiated without being
registered to the server.
For example,
<%
Set q = GetObject ("script:C:\myComponent\cgi.wsc")
%>
If you had scriptlet in the root web directory, you can use like this,
<%
Set q = GetObject
("script:" & Server.MapPath ("cgi.wsc"))
%>
-- OR --
To install permanently (therefore getting rid of specifying a directory), move
this file CGI.wsc to any directory, for example, \winnt\system32 for Windows
NT or 2000, and \windows\system for Windows 95, 98.
Then run the following command from DOS-prompt at the directory where CGI.wsc
exists.
> regsvr32 CGI.wsc
Then the system will display a message box whether it was successful or not.
Registration
You're encouraged to use
this component for a free of charge. You cannot charge for this component for
distribution except minor shipping and handling.
If you do make better improvements, please let us know of the changes, and we
will include it in the next version of this component.
Upgrade
Instructions
Since .WSC components never are locked, you can just overwrite the previous
CGI.wsc, and it will work seamlessly.
| Q&A |
| How
do I upgrade to the latest version? |
Just
download the latest evaluation version, and follow the instruction.
|
| Can
I redistribute this control with my products? |
You
must contact us for redistribution. The license does not include redistribution.
Please contact sales@comsoltech.com
for detail.
|
| com.comsoltech.CGI 1.0
Properties |
| Property |
Description |
| bTrim |
If
True, always run trim() function to get rid of beginning and ending spaces.
If False, return results directly from Request object. |
| com.comsoltech.CGI 1.0
Methods |
| Method |
Parameters |
Return
Value |
Description |
param
p
str |
string |
string |
Returns
the parameter value of either GET or POST as string. (Never returns null) |
zero
num |
string |
double |
Returns
the parameter value as numeric. Guaranteed to be numeric. If null, then
returns zero. |
| safeSQL |
string |
string |
Returns
'null' if empty string or null value. Otherwise, returns quoted string with
single-quote ('), with internal (') replaced with double single quotes ('').
|
| safeSQLint |
string |
double |
Returns
0 if empty string or null value. Otherwise, returns the double value of
the input.
|
| checked |
string,
string |
string |
Returns
"CHECKED" if param(n) = v. Otherwise, returns "" |
| selected |
string,
string |
string |
Returns
"SELECTED" if param(n) = v. Otherwise, returns "" |
set
s
setStr |
string,
string |
N/A |
Sets
the value of the string.
q.set "action", "newValue1" |
| com.comsoltech.CGI 1.0
Example |
' To use as a general Request object.
' Parameter passed in URL: http://localhost/test.asp?action=TestValue1
dim q
set q = Server.CreateObject("com.comsoltech.CGI")
' Use following if cgi.wsc is not registered with regsvr32.exe
' and assuming cgi.wsc is in the virtual web directory /components
' set q = GetObject("script:" & Server.MapPath("/components/cgi.wsc")
Response.Write "Value of action parameter = "
Response.Write q("action") ' prints "TestValue1"
q("action") = "NewValue1" ' this changes the parameter value
Response.Write " New Value of action parameter = "
Response.Write q("action") ' prints "NewValue1"
set q = nothing
|
| |
|
Download
cgi.zip | Support
|