×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Perl Windows Admins

how to use Perlscript To collect data from a web page. by Phalanx1
Posted: 17 Mar 04

here is our simple form, standard name address phone number
with our form with or post method and action

CODE

<html>
<head><meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body>
    <form name="myForm" action="myPage.asp" method="post">
        <br />
        Enter your name:
        <input type="text" name="name" />
        <br />
        Enter your address:
        <input type="text" name="address" />
        <br />
        <br />
        Enter your phone number:
        <input type="text" name="phone" />
        <input type="reset" value="Reset" name="reset" form="form" />
        <br />
        <input type="submit" value="Submit" name="submit" form="form" />
        <br />
    </form>
    </body>
</html>
now after the client submits we on the server side collect by getting the values out of the form with the Request Object.

like so

CODE

$Request->Form('name')->item(1);

view it like you app is talking to someone,
like this:
app:Request?
smone:Request What?
app:the Form data.
smone:Got that, what piece do you want.
app:the piece with the name marked 'name' and the very first item within it.

so this is how we would pull the data from this form.

CODE

<%@ Language="PerlScript" %>
<%
my ($name, $address, $phone);

$name = $Request->Form('name')->item(1);

$address = $Request->Form('address')->item(1);

$phone = $Request->Form('phone')->item(1);

$Response->Write("$name \n $address \n $phone \n");
%>

It's My quote, not your quote, my quote.

Our Environment Molds us, our Desires drive us, and insanity makes us think of all the things in between. by Ryan April.   

Back to Perl FAQ Index
Back to Perl Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close