PDA

View Full Version : POST to cgi script from php script with DHTML Menu



gpyl
12-25-2005, 08:59 PM
I would like to POST to a cgi script a parameter read from an
input text box when pressing a menu option.

My code is:

<script type="text/javascript" language="JavaScript1.2" src="stmenu.js"></script>

<body>

<form action="/cgi-bin/cgi.exe" method="post">
<p>Your name: <input type="text" name="name" /></p>
<p>Your age: <input type="text" name="age" /></p>
<p><input type="submit" /></p>


<script type="text/javascript" language="JavaScript1.2">
<!--
stm_bm(["menu10df",600,"","blank.gif",0,"","",0,0,250,50,1000,1,0,0,"","",0,0,1,0,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,0,2,8,7,100,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0,motion=forward,enabled=0,Duration=0.20)",6,"",-2,90,0,0,"#7F7F7F","#F2F2F2","",0,1,1,"#666666"]);
stm_ai("p0i0",[0,"File","","",-1,-1,0,"#","_self","","","","",0,0,0,"","",0,0,0,0,0,"#D199C6",0,"#D199C6",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#000000","#000000","bold 10pt Verdana","bold 10pt Verdana",0,0]);
stm_aix("p0i1","p0i0",[0,"","","",-1,-1,0,"#","_self","","","","",0,0,0,"","",0,0,0,0,0,"#FFFFFF",1,"#FFFFFF",1,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#000000","#000000","9pt Verdana","bold 9pt Verdana"]);
stm_aix("p0i2","p0i0",[0,"Product Information","","",-1,-1,0,"#","_self","","","","",8,7,0,"arrow_r.gif","arrow_r.gif",7,7,0,0,0,"#E2D7E5",0,"#D6C8DB",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#000000","#000000","8pt Verdana","8pt Verdana"]);
stm_bpx("p1","p0",[1,2,-1,2,0,2,1,0,100,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0,motion=forward,enabled=0,Duration=0.25)",6,"",-2,85,0,0,"#7F7F7F","#D6C8DB","",3]);
stm_aix("p1i0","p0i0",[0,"More Information","","",-1,-1,0,"#","_self","","","","",1,0,0,"","",0,0,0,2,1,"#FFFFFF",1,"#DFE4ED",1,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#000000","#D199C6","bold 8pt Verdana","bold 8pt Verdana"]);
stm_ep();
stm_ai("p0i3",[6,16,"#E2D7E5","",-1,-1,0]);
stm_aix("p0i4","p0i0",[0,"Help","","",-1,-1,0,"#","_self","","","","",0,0,0,"","",0,0,0,0,0,"#CCBE88",0,"#CCBE88"]);
stm_aix("p0i5","p0i1",[]);
stm_aix("p0i6","p0i2",[0,"FAQ ","","",-1,-1,0,"#","_self","","","","",0,0,0,"arrow_r.gif","arrow_r.gif",7,7,0,0,0,"#EAE8DE",0,"#E2DDC9"]);
stm_bpx("p2","p1",[1,2,-1,2,0,2,1,0,100,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0,motion=forward,enabled=0,Duration=0.25)",6,"",-2,85,0,0,"#7F7F7F","#E2DDC9"]);
stm_aix("p2i0","p0i2",[0,"General questions","","",-1,-1,0,"#","_self","","","","",1,0,0,"","",0,0,0,0,1,"#E2DDC9",1,"#EAE8DE"]);
stm_ep();
stm_aix("p0i7","p0i3",[6,16,"#EAE8DE"]);
stm_aix("p0i8","p0i0",[0,"Other","","",-1,-1,0,"#","_self","","","","",0,0,0,"","",0,0,0,0,0,"#89B289",0,"#89B289"]);
stm_aix("p0i9","p0i1",[]);
stm_aix("p0i10","p0i2",[0,"Press Here","","",-1,-1,0,"/cgi-bin/cgi.exe?name=database","_self","","","","",0,0,0,"","",0,0,0,0,0,"#DCE2D9",0,"#C9D3C4"]);
stm_aix("p0i11","p0i3",[6,16,"#DCE2D9"]);
stm_ep();
stm_em();

//-->
</script>
</form>

</body>

-----------------------------------------

The cgi.exe script is called by the "submit" button and the 2 inputs
are POSTED correctly but when pressing the PRESS HERE button
of the menu, the cgi script is called but the parameter name=database
isn't posted. I presume the GET method is used.

My cgi script needs POST method.

Can anyone tell me how to achieved this?

Kind regards,
Jerry