Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Use of javascript (Score:3, Insightful)

    by 2shortplanks (968) on 2002.09.05 10:15 (#12530) Homepage Journal
    I've just being working on something similar. You know that you can assign a keyword to bookmarks in Google? And that if you put a '%s' in the url you can type 'keyword $string' into the url bar and have the url called with %s changed to a urlencoded version of $string.

    This works all very well until something needs a POST not a GET. So I have this script that takes any request and resubmits it to the defined url as a post:


    # force as a hardcoded value for security reasons
    use constant URL => "";

    use CGI;
    my $q = CGI->new();

    # start the page
    print $q->header;
    print $q->start_html(-onLoad => "document.myform.submit()");
    print "Please wait...";

    # start the form
    print $q->start_form(-name   => "myform",
                         -action => URL);

    # print out all values
    foreach ($q->param())
      print $q->hidden(-name  => $_,
                       -value => $q->param($_)) . "\n";

    print $q->end_form;
    print $q->end_html;
    Now the important thing to note is that this script doesn't even have a submit button - as soon as the page is loaded javascript submits the page.

    Of course this will only work if you know they have javascript enabled (which in this case I do - it's my browser)