<html>
<head>
</head>
<body>
<form action="default.asp" method="post">
<input name="file" type="radio" value="a">a<br>
<input name="file" type="radio" value="b">b<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
<% @language=vbscript %>
<html>
<head>
</head>
<body>
<%
dim filename
filename = request.form("file")
response.write filename
response.write "<br><hr>"
if filename = "a" then
response.write "<br>a"
end if
%>
</body>
</html>
I can easily replace the input lines with the
following anchors in the HTML file, but I'm not
sure how to access the querystring. default.asp
is not accessable for some reason. What am I
doing wrong?
<a href="default.asp?file=a">a</a>
<a href="default.asp?file=b">b</a>
Next, I want to convert this example to PerlScript.
Is this code close?
<% @language=PerlScript %>
<html>
<head>
</head>
<body>
<%
$filename = $request->form("file");
$response->write(filename);
$response->write("<br><hr>");
if $filename eq "a" {
$response->write("<br>a");
}
%>
</body>
</html>
This simple example will solve a world of problems
for me. I have experience programming client side
applications, but have no experience with server
side applications.
Sent via Deja.com http://www.deja.com/
Before you buy.
Hi!
Let's see what we can help you with ...
>default.asp is not accessable for some reason. What am I doing wrong?
From what I saw, you called on default.asp with the "post"-method,
which means that any data is not attached to the querystring but
instead sent with the HTTP body. It will by design be available in the
Form collection. The code would be:
# This is default.asp
<a href="default.asp?file=<%=$Request->Form("filename")->Item()%
>">link</A>
However, there is a problem with the above creation. Namely the
construct of the link uses "?" which indicates that a querystring
follows past the "?" in the URL. This means that you must change your
form method to "GET" and request any data as:
<a href="default.asp?file=<%=$Request->QueryString("filename")->Item()%
>">link</A>
> Next, I want to convert this example to PerlScript.
>
> <% @language=PerlScript %>
> <html>
> <head>
> </head>
> <body>
> <%
> $filename = $request->form("file");
> $response->write(filename);
> $response->write("<br><hr>");
> if($filename eq "a") {
> $response->write("<br>a");
> }
> %>
> </body>
> </html>
Yup. I only added the parenthesis in the if statement.
> This simple example will solve a world of problems
> for me. I have experience programming client side
> applications, but have no experience with server
> side applications.
Happy to be of help :)
--
Tobias