katgirl has asked for the wisdom of the Perl Monks concerning the following question:
The place where I work has a firewall which stops me from posting on my favourite forum (Sorry, meant 2nd favourite ;) so I wrote a script that will pull the data from the forum and display it through my site, sidestepping the headers that define the forum as a forum. All ok so far?
I've managed to get the links to work (the site has relative links) but posting data to the forum is impossible - I just go back to the start page I made. (I'm not bothered about the pictures not working)
Please could you tell me:
#!/usr/bin/perl -w BEGIN { $|++; } use strict; use lib "/usr/local/www/virtual/katgirl/modules"; use LWP::Simple qw(!head); use CGI::Carp qw(fatalsToBrowser); use CGI qw/:standard/; my $url = param("url"); my $surfurl = param("surfurl"); my $surfur1 ||= $url; #if(!$surfurl){$surfurl = $url; } my @file; print header, start_html('web getter'); if($url){ if($url =~ m/action/ig){ @file = post($url); }else{ @file = get($url); } foreach my $line(@file){ #chomp($line); $line =~ s!href=\"!href=\"?surfurl=$surfurl&url=$surfurl\/!gi; $line =~ s!src=\"!src=\"$surfurl\/!gi; $line =~ s!action=\"!action=\"?surfurl=$surfurl&url=$surfurl\/ +!gi; print $line; } }else{ print p("Where do you want to go today?"), start_form, textfield(-default =>"http://", -name=> "url"), submit(-name=> "GO!"), end_form; } print end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Posting form data from within a virtual browser
by dws (Chancellor) on Jul 17, 2003 at 16:03 UTC | |
|
Re: Posting form data from within a virtual browser
by sgifford (Prior) on Jul 17, 2003 at 16:02 UTC | |
|
Re: Posting form data from within a virtual browser
by mpeppler (Vicar) on Jul 17, 2003 at 16:20 UTC |