From: "dan" <[EMAIL PROTECTED]> > Experiencing a little, if not more, difficulty in attempting to > achieve what's probably a simple task. Here's the situation. > > The user presses a button. The website takes them to a page where they > can sign up for a selected package, entering a username and password. > They then press the "next" button, which sends them to a script which > checks a couple of things, such as if the password's correct in both > fields, if the username's taken, this that and the other. The site > (without displaying another page) must take them to another page, > POSTing the information it's aquired, plus more which were hidden > fields in the form. So far i have: > > $query = "packed query here"; > $query =~ tr/ /+/; > $query =~ s/pack("C", hex($1))/[a-fA-F0-9]/eg; Beg your pardon???
> $ua = new LWP::UserAgent; > $req = new HTTP::Request 'POST','http://url.to.post.to/script; > $req->content_type('application/x-www-form-urlencoded'); > $req->content($query); > $res = $ua->request($req); > > but what happens next? Will this even do what I want it to? The way I > have the script setup, when it reaches that last line, it executes the > default sub to run through the template file and print data to the > browser. Naturally I don't want it to do that, I want it to either a) > tell the user that something's wrong (which i can deal with), or if > everything's ok, then b) POST data to an URL and forward them to the > website involved with the POST, which will display content on what > data it's given. You can't post the data to the website from the script and expect them to go to the user. You have to post the data, get the response and print the content to the user. Therefore the user will not be redirected, it will get the data directly from the script. You may need to process the content to fix the links and inline images because the content will assume the browser thinks the current URL is http://url.to.post.to/script, but the browser will have the URL of your script as current. The easiest will be to add <base href="http://url.to.post.to/script"> into the <head> element. HTH, Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>