CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Pwease help dis nOOb!

 



Always IN Chaos
Novice

Feb 13, 2003, 12:12 AM

Post #1 of 10 (1522 views)
Pwease help dis nOOb! Can't Post

I need help / examples of Perl forms ... I'll include a html form, which I'd like to duplicate into perl form :

I cut out the url and stuff but here we go!

<FORM METHOD=POST target=right ACTION=" " >
Username:<INPUT TYPE=TEXT SIZE=6 NAME=Username Value=Username>
Password:<INPUT TYPE=PASSWORD SIZE=6 NAME=Password value=Password>
<input type=checkbox name=altdisp checked value=true>
<INPUT TYPE=SUBMIT VALUE="Enter">
</form>



So I guess what i'm asking is how to use



Post action along with inputs and submitting all at once.



like I said, i'm a nOOb ta this, pwease help ;)!!!


davorg
Thaumaturge / Moderator

Feb 13, 2003, 1:15 AM

Post #2 of 10 (1514 views)
Re: [Always IN Chaos] Pwease help dis nOOb! [In reply to] Can't Post

(Please make an effort to choose a better subject line for your posts)

I'm not sure I understand your question. What do you mean by "perl form". Forms are HTML. They have nothing to to with Perl. It's possible to create an HTML form form a Perl program, but all you do it print the HTML that you want displayed.

Code
print <<END_HTML 
<form method="post" target="right" action=" " >
Username:<input type="text" size="6" name="Username"
Value=Username />
Password:<input type="password" size="6"
name="Password" value="Password" />
<input type="checkbox" name="altdisp" checked="checked"
value="true" />
<input type="submit" value="Enter" />
</form>
END_HTML

Does that help?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


Always IN Chaos
Novice

Feb 13, 2003, 2:14 AM

Post #3 of 10 (1513 views)
Re: [Always IN Chaos] Pwease help dis nOOb! [In reply to] Can't Post

ok how about this .. how do I , In perl, send to a url what that html form generates...



so it sends the Username + password and submits it. in that instance.


Always IN Chaos
Novice

Feb 13, 2003, 2:21 AM

Post #4 of 10 (1511 views)
Re: [Always IN Chaos] Pwease help dis nOOb! [In reply to] Can't Post

Can't find string terminator "END_HTML" anywhere before EOF at hmm.pl line 5.





thats what your above code gave me ;(


thodi
stranger

Feb 13, 2003, 2:29 AM

Post #5 of 10 (1510 views)
Re: [Always IN Chaos] Pwease help dis nOOb! [In reply to] Can't Post


In Reply To
Can't find string terminator "END_HTML" anywhere before EOF at hmm.pl line 5.
thats what your above code gave me ;(

Then you didn't copy it right.


Always IN Chaos
Novice

Feb 13, 2003, 2:36 AM

Post #6 of 10 (1508 views)
Re: [thodi] Pwease help dis nOOb! [In reply to] Can't Post

yes i did..


thodi
stranger

Feb 13, 2003, 2:37 AM

Post #7 of 10 (1508 views)
Re: [Always IN Chaos] Pwease help dis nOOb! [In reply to] Can't Post


In Reply To
ok how about this .. how do I , In perl, send to a url what that html form generates...

so it sends the Username + password and submits it. in that instance.

Something like this?

Code
use strict; 
use warnings;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
my $response = $ua->post('http://form-url', { Pasword => 'pass', Username => 'user' });

Edit: Sorry, I used put instaed of post.


(This post was edited by thodi on Feb 13, 2003, 3:08 AM)


Always IN Chaos
Novice

Feb 13, 2003, 9:18 AM

Post #8 of 10 (1502 views)
Re: [thodi] Pwease help dis nOOb! [In reply to] Can't Post

I believe thats working ;) is there a way to add multiple lines like that , do I need differn varibles?


davorg
Thaumaturge / Moderator

Feb 14, 2003, 2:08 AM

Post #9 of 10 (1495 views)
Re: [Always IN Chaos] Pwease help dis nOOb! [In reply to] Can't Post

Check that there's no extra whitespace at the end of the "END_HTML" line.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


SaiyanM
User

Feb 24, 2003, 3:26 PM

Post #10 of 10 (1486 views)
Re: [davorg] Pwease help dis nOOb! [In reply to] Can't Post

theres no ";" after the first END_HTML line

-------------
Whats 2 + 2 x 2?
Its not 8...
(Please Excuse My Dear Aunt Sally)...

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives