I don't think you can. You could provide a proxy on your site, that does the actual request on the other site and passes the result back to your browser.
There has been a user here, ant9000, who did something for Perlmonks, for a Ajax based Chatterbox client. The proxy is still alive: http://www.netwise.it/xml/perlmonks/.
Since then, this user has disappeared.
| [reply] |
If I understand your question correctly, sounds like LWP will solve your problem.
## http://mysite/goto.pl ##
use strict;
use LWP::UserAgent;
my $url = 'http://otherwebsite/deeplink.html';
my $ua = LWP::UserAgent->new;
my $response = $ua->post(
$url,
[username=>'username', password=>'password'],
);
if ($response->is_success) {
my $deeplink = $response->content;
print $deeplink;
} else {
my $errmsg = $response->status_line;
....
}
| [reply] [d/l] |
I like to have user goto other site, rather than print the cotent of that site even in frames. Such is the case, because othersite want to do something with user login.
| [reply] |
I do not want to show username/password openly.
Define "openly".
If you need the user's web browser to retrieve the password-protected content from the password-protected site, then the user's web browser has to have the username and password, so ipso facto the user has the ability to see it as well.
There are various cheap tricks you can pull to (try to) conceal this fact from users who don't understand computer networks very well, but fundamentally the information will be _available_ to the user, and any user who knows the difference between an HTTP header and a document head element is going to be able to figure it out. If that's good enough for your purposes, say so, because otherwise most people on here are going to assume it's probably not.
If you need the user to see the password-protected content but _not_ be able to see the username and password, then the content needs to be retrieved from the password-protected server not by the user's web browser but by a system beyond the user's control, such as your website.
Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. You can just call me "Mister Sanity". Why, I've got so much sanity it's driving me crazy.
| [reply] |
As others have said, with no special support on the other site, the only way to do exactly what you describe is to use a proxy. This is actually pretty easy with a little bit of mod_perl.
It's possible the other Web site implements a special way of doing this, such as passing along an encrypted string or temporary authentication token. You could ask the site's maintainer if there are any options for that. If you are the maintainer of both sites, you could implement something special you can pass instead of a password that will be enough for authentication.
| [reply] |
| [reply] |