This is going to take some explaining!

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:

  1. Why I can't post (probably overlooking something obvious)
  2. How to fix the above
(btw - I'm already working on the absolute links, so no need to tell me off about that!)
#!/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;

In reply to Posting form data from within a virtual browser by katgirl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.