Basics. Please Help

xyciana

New Member
Can someone please tell me how to send parameters to a progress webspeed file and how to pick these up in the progress file.

A simple example would be great.


http://www.webspeed.sunrisemedical.co.uk/cgi-bin/wspd_cgi.sh/WService=wsbroker1/samples/program1.p <-- Want to pass a parameter here?

/* program1.p */

{src/web/method/cgidefs.i}
def input parameter x as character. <--- So it picks it up here.

RUN OutputContentType IN web-utilities-hdl ("text/html":U).

{&OUT}
x
{&END}

Also how do I set, hold and retrieve session data. Again a simple example would be really nice.

My head is on the block - Please help
 
1)You can get CGI session variables like this:
usr_lang_prefs = get-cgi("HTTP_ACCEPT_LANGUAGE").

2)WebSpeed variables like hostURL or
appURL are available like any progress
variable.
3) to send and retrive parametres you can use something like:
http://localhost/cgi-bin/wspd_cgi.sh/WService=svrequest/toto.p?myVariable=Hello
or 4GL code:
hostURL + appURL + "toto.p?myVariable=Hello".
.... the variable "myVariable" can be take with:
DEF VAR lc AS CHAR NO-UNDO.
lc = get-field("myVariable").

rares
 
Thank You. I have made much progress.

I finally discovered src/web/method/cgidefs.i but still cannot set session variables and retrieve them later.

I have used set-user-field("smecacct",out-account) and
get-user-field("smacacct").

HTML PAGE -> Progress Webspeed (Framed HTML) -> HTML Page in frame 1 (on submit) -> Progress Webspeed in Frame 2 but my get-user-field is empty.

This is all within one browser session. Within the first Progress Webspeed program, I can set and retrieve O.K. but I need to set and retrieve for the whole browser session.

Can anyone advise?

I have an alternative but need a unique identifying tag for the browser session to store the session in a database. Does anyone know what session variable would give me the unique identifying tag for a browser session? I cannot use SERVER_ADDR or SERVER_PORT because several people use the same PC. Also a cookie has its own security risk. Someone must have done this somewhere :).
 
You can pass parameters via a query string or hidden fields in the webspeed app.

http:://www.mysite.com/script/wsisa.dll/html/myfile2.htm?value1=1&value2=2 and so forth.

or in your form using hidden fields

<form action="myfile2.htm" name="myform" method="post">
<input type="hidden" name="value1" value="1">
<input type="hidden" name="value2" value="2">

myfile2.htm would be the file receiving the passed values. So myfile1.htm would be the file passing the values containing a link with a querystring or a form with the hidden fields.

in myfile2.htm you would receive the values. I'll define a variable and receive the values like this:

<html>
<head>

<script LANGUAGE=speedscript>

def vvalue1 as char no-undo.
def vvalue2 as char no-undo.

Assign vvalue1 = get-value("value1")
vvalue2 = get-value("value2").

for each bla blah where salesman = vvalue1 and so forth.



then just run your program as a webspeed object and plug in your values. You dont even need the variables, just set your values = to the get-value("").

Hope this helps. Progress REALLY needs to get some useful books out on the market with some applicable demonstrations on using webspeed instead of forcing folks to take their pricey classes. There are the hidden costs with Progress. Lack of information is one of them.
 
Back
Top