By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,824 Members | 1,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,824 IT Pros & Developers. It's quick & easy.

Redirecting user via post

P: n/a
Hi

I just made a script that gets a bunch of login info and I've come across a
hurdle that I failed to think about it.. and now think I may have wasted my
time...

The login info I retreive needs to be POSTed to another site. Everything is
beautiful, except now I don't know how to go about it..

I could use Location: URL but I have to chuck on the login info in the URL
which would then be visible to the naked eye.

Is there a way to POST it.. ? Been a while since I messed with web stuff so
any help appreciated.

Please help.

TIA
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Brendan" <bj*@adsl.onnet> wrote in message
news:40********@duster.adelaide.on.net...
Hi

I just made a script that gets a bunch of login info and I've come across a hurdle that I failed to think about it.. and now think I may have wasted my time...

The login info I retreive needs to be POSTed to another site. Everything is beautiful, except now I don't know how to go about it..

I could use Location: URL but I have to chuck on the login info in the URL
which would then be visible to the naked eye.

Is there a way to POST it.. ? Been a while since I messed with web stuff so any help appreciated.


Use the HTTP status code 307:

header("HTTP/1.0 307 Temporary Redirect");
header("Location: http://www.example.com/");

When the incoming request is a POST, the browser post to the redirected page
as well. Note that in some non-standard browsers a warning would appear.
Jul 17 '05 #2

P: n/a
Chung Leong <ch***********@hotmail.com> wrote:
The login info I retreive needs to be POSTed to another site. Everything

is
beautiful, except now I don't know how to go about it..

I could use Location: URL but I have to chuck on the login info in the URL
which would then be visible to the naked eye.

Is there a way to POST it.. ? Been a while since I messed with web stuff

so
any help appreciated.


Use the HTTP status code 307:

header("HTTP/1.0 307 Temporary Redirect");
header("Location: http://www.example.com/");

When the incoming request is a POST, the browser post to the redirected page
as well. Note that in some non-standard browsers a warning would appear.


My guess is this is not what the OP acutally wants. Unless he wants to
redirect the browser to the other site (in that case pointing the action
directly to the site might be easier).

My guess is that he wants to do the post from within his own php, in
that case he could take a look at curl, snoopy
(http://sourceforge.net/projects/snoopy/) or an code snipper I once
posted here
(http://groups.google.com/groups?selm...%40news.tue.nl)

--

Daniel Tryba

Jul 17 '05 #3

P: n/a
"Chung Leong" <ch***********@hotmail.com> wrote in message
news:nb********************@comcast.com...
"Brendan" <bj*@adsl.onnet> wrote in message
news:40********@duster.adelaide.on.net...
Hi

I just made a script that gets a bunch of login info and I've come across
a
hurdle that I failed to think about it.. and now think I may have wasted my
time...

The login info I retreive needs to be POSTed to another site. Everything

is
beautiful, except now I don't know how to go about it..

I could use Location: URL but I have to chuck on the login info in the

URL which would then be visible to the naked eye.

Is there a way to POST it.. ? Been a while since I messed with web stuff

so
any help appreciated.


Use the HTTP status code 307:

header("HTTP/1.0 307 Temporary Redirect");
header("Location: http://www.example.com/");

When the incoming request is a POST, the browser post to the redirected

page as well. Note that in some non-standard browsers a warning would appear.


Excellent! That works great, thanks.
Jul 17 '05 #4

P: n/a
"Daniel Tryba" <ne****************@canopus.nl> wrote in message
news:c6**********@news.tue.nl...
Chung Leong <ch***********@hotmail.com> wrote:
The login info I retreive needs to be POSTed to another site. Everything
is
beautiful, except now I don't know how to go about it..

I could use Location: URL but I have to chuck on the login info in the
URL which would then be visible to the naked eye.

Is there a way to POST it.. ? Been a while since I messed with web
stuff so
any help appreciated.


Use the HTTP status code 307:

header("HTTP/1.0 307 Temporary Redirect");
header("Location: http://www.example.com/");

When the incoming request is a POST, the browser post to the redirected page as well. Note that in some non-standard browsers a warning would appear.


My guess is this is not what the OP acutally wants. Unless he wants to
redirect the browser to the other site (in that case pointing the action
directly to the site might be easier).


It's a bit more than that. I need to check a radio option that the user
selects, and then the form data they entered gets posted to the site
depending on what radio option they selected.
My guess is that he wants to do the post from within his own php, in
that case he could take a look at curl, snoopy
(http://sourceforge.net/projects/snoopy/) or an code snipper I once
posted here
(http://groups.google.com/groups?selm...%40news.tue.nl)


Thanks for your help.
Jul 17 '05 #5

P: n/a
"Daniel Tryba" <ne****************@canopus.nl> wrote in message
news:c6**********@news.tue.nl...

My guess is this is not what the OP acutally wants. Unless he wants to
redirect the browser to the other site (in that case pointing the action
directly to the site might be easier).

My guess is that he wants to do the post from within his own php, in
that case he could take a look at curl, snoopy
(http://sourceforge.net/projects/snoopy/) or an code snipper I once
posted here
(http://groups.google.com/groups?selm...%40news.tue.nl)


But then the user doesn't get redirected to the other site. If you need to
alter the form data before the redirection occurs, I think the only way is
to generate a form with the altered data in hidden fields, then submit the
form automatically using Javascript.
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.