M
mozilla.bugzilla
hi, there
I am a newer to perl. I am trying to write a perl program to
automaticlly submite the form to the webserver.
here is the original html source code,
<form name="ecomm_frm" method="post" action="process.aspx?c=us&"
id="ecomm_frm">
<input type="hidden" name="EVENTTARGET" value="EditView:OptOutButton"
/>
<input type="hidden" name="EVENTARGUMENT" value="" />
<input type="hidden" name="VIEWSTATE" value="dDwxMDcyMzE"/>
<script language='javascript'>
<!--
function doPostBack(eventTarget, eventArgument) {
var theform = document.forms['ecomm_frm'];
if( theform == null )
{
//-- Second form is not the search molecule
theform = document.forms[0];
}
theform.EVENTTARGET.value = eventTarget;
theform.EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
<input name="EditView:first" type="text" id="EditView_first" />
<input name="EditView:last" type="text" id="EditView_last" />
<input name="EditView:mEmail" type="text" maxlength="50"
id="EditView_mEmail" />
<a
href="javascript:doPostBack('subscriber:SubmitButton','')">Submit</a>
</form>
Following is my perl code,
////////////////////////////////////////////////
#!/usr/bin/perl
use strict;
use warnings;
use LWP 5.64;
my $browser = LWP::UserAgent->new;
my $url ='http://mywebsite.......';
my $response = $browser->post( $url,
[ EditView:first => 'mozilla',
EditView:last => 'bugzilla',
EditView:mEmail => '(e-mail address removed)',
EVENTTARGET=>'subscriber:SubmitButton',
EVENTARGUMENT=>'',
VIEWSTATE=>'dDwxMDcyMzE',
]
);
die "$url error: ", $response->status_line
unless $response->is_success;
die "Weird content type at $url -- ", $response->content_type
unless $response->content_type eq 'text/html';
print $response->content;
//////////////////////////////
when I tried to run this, the system always told me there are errors in
these 3 lines: syntax error at line 13 near "Editview". Seems that I
can not include ":" in the entity name. Would you guys help me how to
figure this out? Thanks.
EditView:first => 'mozilla',
EditView:last => 'bugzilla',
EditView:mEmail => '(e-mail address removed)',
I am a newer to perl. I am trying to write a perl program to
automaticlly submite the form to the webserver.
here is the original html source code,
<form name="ecomm_frm" method="post" action="process.aspx?c=us&"
id="ecomm_frm">
<input type="hidden" name="EVENTTARGET" value="EditView:OptOutButton"
/>
<input type="hidden" name="EVENTARGUMENT" value="" />
<input type="hidden" name="VIEWSTATE" value="dDwxMDcyMzE"/>
<script language='javascript'>
<!--
function doPostBack(eventTarget, eventArgument) {
var theform = document.forms['ecomm_frm'];
if( theform == null )
{
//-- Second form is not the search molecule
theform = document.forms[0];
}
theform.EVENTTARGET.value = eventTarget;
theform.EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
<input name="EditView:first" type="text" id="EditView_first" />
<input name="EditView:last" type="text" id="EditView_last" />
<input name="EditView:mEmail" type="text" maxlength="50"
id="EditView_mEmail" />
<a
href="javascript:doPostBack('subscriber:SubmitButton','')">Submit</a>
</form>
Following is my perl code,
////////////////////////////////////////////////
#!/usr/bin/perl
use strict;
use warnings;
use LWP 5.64;
my $browser = LWP::UserAgent->new;
my $url ='http://mywebsite.......';
my $response = $browser->post( $url,
[ EditView:first => 'mozilla',
EditView:last => 'bugzilla',
EditView:mEmail => '(e-mail address removed)',
EVENTTARGET=>'subscriber:SubmitButton',
EVENTARGUMENT=>'',
VIEWSTATE=>'dDwxMDcyMzE',
]
);
die "$url error: ", $response->status_line
unless $response->is_success;
die "Weird content type at $url -- ", $response->content_type
unless $response->content_type eq 'text/html';
print $response->content;
//////////////////////////////
when I tried to run this, the system always told me there are errors in
these 3 lines: syntax error at line 13 near "Editview". Seems that I
can not include ":" in the entity name. Would you guys help me how to
figure this out? Thanks.
EditView:first => 'mozilla',
EditView:last => 'bugzilla',
EditView:mEmail => '(e-mail address removed)',