POST and ASP and others...

2001-03-12 Thread Mark Luetzelschwab


Hi All,

I saw a couple of postings related to POST and ASP...and never really 
saw an answer...as far as I can tell, this solution works for ASP and 
some other web servers (HTML/OS) that accept a POST command.

This example works for ASP..by modifying the httpHeaders just ever so 
slightly. The addition is:

  set the httpHeaders to "Content-type: 
application/x-www-form-urlencoded"return

make a field with the name "Earl" and put the url into it (i.e. 
http://localhost/default.asp)
make a field with the name "data" and put some text in there (i.e. hi )
make a button and put the following script.

on mouseUp
   set the httpHeaders to "Content-type: 
application/x-www-form-urlencoded"return
   # The trailing return is the key...without it, this spits back all 
sorts of errors.
   put field "Earl" into mURL
   put "myText="field data into tText
   post tText to URL mURL
   put it
end mouseUp

The ASP file (i.e. http://localhost/default.asp)

should have:

% Language=VBScript %
html
head/head
body
%
Response.Write Request.Form("myText")
%
/body
/html

The html, head and body tags arent really necessary.

It should just spit back what you put in the data field.

-ml

 
Mark J. Luetzelschwab   [EMAIL PROTECTED]
Graduate Research Assistant (v) (512) 232 6034
Instructional Technology(f) (512) 232 2322
Reading and Language Arts:
http://www.texasreading.org

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: POST and ASP and others... !!!

2001-03-12 Thread Pierre Sahores

Mark Luetzelschwab a crit :
 
 Hi All,
 
 I saw a couple of postings related to POST and ASP...and never really
 saw an answer...as far as I can tell, this solution works for ASP and
 some other web servers (HTML/OS) that accept a POST command.
 
 This example works for ASP..by modifying the httpHeaders just ever so
 slightly. The addition is:
 
   set the httpHeaders to "Content-type:
 application/x-www-form-urlencoded"return
 
 make a field with the name "Earl" and put the url into it (i.e.
 http://localhost/default.asp)
 make a field with the name "data" and put some text in there (i.e. hi )
 make a button and put the following script.
 
 on mouseUp
set the httpHeaders to "Content-type:
 application/x-www-form-urlencoded"return
# The trailing return is the key...without it, this spits back all
 sorts of errors.
put field "Earl" into mURL
put "myText="field data into tText
post tText to URL mURL
put it
 end mouseUp
 
 The ASP file (i.e. http://localhost/default.asp)
 
 should have:
 
 % Language=VBScript %
 html
 head/head
 body
 %
 Response.Write Request.Form("myText")
 %
 /body
 /html
 
 The html, head and body tags arent really necessary.
 
 It should just spit back what you put in the data field.
 
 -ml

First : THANK'S A LOT MARK. Because you found the right way to use the "POST"
method from within Metacard, we are, from yet, able to build great mc based
web/vpn broswers !!!

Second : By cloning your solution to use it in conjunction with php instead of
asp, this works too :

the mc button test script :

on mouseUp
  if the shiftkey is down then edit script of me
  else
put "a=test" into Envoi
set httpheaders to "Content-type: application/x-www-form-urlencoded" 
return
post Envoi to url ("http://"  fld "serveurcible" of cd 1  "/wmc3.xml")
put it
  end if
end mouseUp

the php test script (stored as the "wmc3.xml" file) :

?

if ($REQUEST_METHOD == POST) {

$headers = $HTTP_POST_VARS;
while (list($header, $value) = each($headers)) $exAE .= "$header=$value";
print($exAE."reu");

}

?

Successfully tested, using Suse-Linux 7.0/Apache 1.3.12/PHP 3.0.16/MC 2.32.
Probably ok too in using WinNT4-SP5/IIS4/PHP4/MC 2.32 (not tested for yet).

Thank's again, Mark :-))

 
 
 Mark J. Luetzelschwab   [EMAIL PROTECTED]
 Graduate Research Assistant (v) (512) 232 6034
 Instructional Technology(f) (512) 232 2322
 Reading and Language Arts:
 http://www.texasreading.org
 
 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.

-- 
Pierre Sahores

WEB  VPN applications  databases servers
Inspection acadmique de Seine-Saint-Denis
Qualifier et produire l'avantage comptitif

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.