treasurehuntbob has asked for the wisdom of the Perl Monks concerning the following question:

Heres a example below of what im doing. I want to tweak this so that i can load the request page without it staying or searching on my server for the images etc... Another wards only "bob.com" has access to "tom.com" thru a "HTTP_REFERER" and i want to access tom.com by tricking it to think im bob.com. Is there a better way of doing this or can i use a redirect or hyperlink or something HELP!!!!!
#!/usr/bin/perl use LWP::UserAgent; use HTTP::Request; use HTTP::Headers; use CGI; $h = new HTTP::Headers Referer => 'http://bob.com/fun.htm'; $ua = LWP::UserAgent->new; $request = HTTP::Request->new(POST => "http://tom.com",$h); $response = $ua->request($request); print "Content-type: text/html\n\n"; print $response->content;

Replies are listed 'Best First'.
Re: http headers; http request; cgi; get; post HELP HELP
by merlyn (Sage) on Mar 05, 2001 at 19:41 UTC
    My oft repeated Mantra for LWP: "use HTTP::Request::Common" and "perldoc lwpcook". Repeat as necessary.
    use LWP::UserAgent; use HTTP::Request::Common; my $ua = LWP::UserAgent->new; my $response = $ua->request(POST "http://tom.com", [form1 => value1, f +orm2 => value2], Referer => 'http://bob.com/fun.htm');

    -- Randal L. Schwartz, Perl hacker

Re: http headers; http request; cgi; get; post HELP HELP
by treasurehuntbob (Initiate) on Mar 06, 2001 at 03:50 UTC
    YES; the above is good but i was told:

    You need to rewrite all the URLs on the way through...
    Then you don't need the BASE, but you *do* need to handle any subsequent requests.


    because its looking for the pages on my URL rather than the one being requested; so i insert a base href in the print code so that everything looks good but then the server asks for a user and password.
    HELP!! I really want to fix this problem.