make url with javascript

A

autogoor

Hi,

I have a web page for user to input rectangle dimensions, say (10, 10,
100, 40), and then forward the information to a cgi with a url
something like
http://mydomain.com/cgi-bin/myapp?shape=rectangle&dim=10,10,100,40

But the url generated is
http://mydomain.com/cgi-bin/myapp?shape=rectangle&dim=10,10,100,40.
How can I fix it?

thanks,

autogoor

Here is my html for the page

<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function makeurl () {
var url = document.para.x.value + ",";
url = url + document.para.y.value + ",";
url = url + document.para.z.value + ",";
url = url + document.para.c.value;
document.act.Dim.value=url;
document.act.submit();
}
</SCRIPT>
</head>
<body>

<form name=act action=http://mydomain.com/cgi-bin/myapp>
<input type=hidden name=shpae value=rectangle>
<input type=hidden name=Dim>
</form>

<form name=para>
<table border=0>
<tr>
<td>Width</td><td><input type=text name=x></td>
</tr>
<tr>
<td>Height</td><td><input type=text name=y></td>
</tr>
<tr>
<td>Z-sections</td><td><input type=text name=z ></td>
</tr>
<tr>
<td>Channels</td><td><input type=text name=c></td>
</tr>
<tr>
<td></td>
<td><input type="button" value="Create" onClick="makeurl()"></td>
</tr>

</table>
</form>

</body>
</html>
 
G

Grant Wagner

Hi,

I have a web page for user to input rectangle dimensions, say (10, 10,
100, 40), and then forward the information to a cgi with a url
something like
http://mydomain.com/cgi-bin/myapp?shape=rectangle&dim=10,10,100,40

But the url generated is
http://mydomain.com/cgi-bin/myapp?shape=rectangle&dim=10,10,100,40.
How can I fix it?

It can't be "fixed", nor would you want it to be.

When /cgi-bin/myapp reads the parameters, it should automagically URI
decode the value of dim. If it does not, you will need to write your own
decode or use one provided by the environment you are using on the
server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top