For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > October 2006 > Finding form field for this html









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Finding form field for this html
Nospam

2006-10-30, 7:10 pm

I can't seem to find the form field or even form name for this particular
page, the relevant html is:

<form method="post" action="/cgi-bin/add_posting.pl" name="add_posting">
<input type="hidden" name="changedImages" value="">
<input type="hidden" name="pid" value="4112">
<input type="hidden" name="posting_cat" value="3749">
<input type="hidden" name="action" value="preview_or_images">
<input type="hidden" name="site_id" value="79">
<input type="hidden" name="posting_id" value="">

I have tried form(1); and it states there is no such form, I have also tried
form("add_posting.pl") and it said no such form "add_posting", the url to
the site is http://hull.gumtree.com/cgi-bin/add...osting_cat=3749


Mark Clements

2006-10-30, 7:10 pm

Nospam wrote:
> I can't seem to find the form field or even form name for this particular
> page, the relevant html is:
>
> <form method="post" action="/cgi-bin/add_posting.pl" name="add_posting">
> <input type="hidden" name="changedImages" value="">
> <input type="hidden" name="pid" value="4112">
> <input type="hidden" name="posting_cat" value="3749">
> <input type="hidden" name="action" value="preview_or_images">
> <input type="hidden" name="site_id" value="79">
> <input type="hidden" name="posting_id" value="">
>
> I have tried form(1); and it states there is no such form, I have also tried
> form("add_posting.pl") and it said no such form "add_posting", the url to
> the site is http://hull.gumtree.com/cgi-bin/add...osting_cat=3749
>
>

Works for me.


mark@owl:~/Dev/perl$ cat form.pl
use strict;
use warnings;

use Data::Dumper;
use WWW::Mechanize;

my $mech = WWW::Mechanize->new();

my $url =
q(http://hull.gumtree.com/cgi-bin/add...osting_cat=3749);
my $form_name = q(add_posting);

$mech->get( $url );

my $form = $mech->form_name($form_name);

print $form->method()."\n";
print $form->action()."\n";
print join "\n",$form->param(),"\n";

mark@owl:~/Dev/perl$ perl form.pl
POST
http://hull.gumtree.com/cgi-bin/add_posting.pl
changedImages
pid
posting_cat
action
site_id
posting_id
current_live_date
location
location_required
title
description
contact_email
other_contactable
skype_id
anonymous_email
anti_spam
first_name
last_name
user_email
password
action_images
action_preview

mark@owl:~/Dev/perl$
Henry Law

2006-10-30, 7:10 pm

Nospam wrote:
> I can't seem to find the form field or even form name for this particular
> page, the relevant html is:


For heaven's sake take more care about the way you're asking your
questions. You are making it very hard for people to help you, and
people will get tired of trying to do so very quickly. My advice: read
the posting guidelines for this group and follow them; they really are
intended to help you get the help you want.

> <form method="post" action="/cgi-bin/add_posting.pl" name="add_posting">

....
> <input type="hidden" name="site_id" value="79">
> <input type="hidden" name="posting_id" value="">


This is HTML, so I'm assuming you've got it into your Perl program
somehow. Best show us how.

> I have tried form(1);


You "tried" it; just how did you try it? I just tried it in a one-line
Perl program and got the message "Undefined subroutine &main::form" (of
course), so you must have done some other coding. Show us.

Hint (based on the posting guidelines): write a small program - ten
lines or so - which contains the very code that doesn't do what you
intend, and post it here. People will leap upon it and tell you what's
the matter with it.

--

Henry Law <>< Manchester, England
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com