Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirecting or forwarding to another website

 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a form on a web page and when the user clicks on the button of the form the action (part of the form) goes to page X and it passes some parameters.

The page X should forward or redirect to another website using the post method passing these parameters as well.

Ahy suggestions?

Thank you in advance.

pinda
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The page X should forward or redirect to another website using the post method passing these parameters as well.
Ahy suggestions?


Pinda,
When you say another website, do you mean another context on your server, another page in your context, or literally, another site some place on another server?
[ February 10, 2005: Message edited by: Ben Souther ]
 
Rigel Kentaurus
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pinda Ros:
Hello,

I have a form on a web page and when the user clicks on the button of the form the action (part of the form) goes to page X and it passes some parameters.

The page X should forward or redirect to another website using the post method passing these parameters as well.

Ahy suggestions?

Thank you in advance.

pinda



With javascript, in the page X:

<form method="post" action="wherever">
<input type="hidden" name="var" value="value" />
</form>

<script>
document.forms[0].submit();
</script>
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ben I mean literrally to a different web site eg:

my site www.example.com

referenced site: www.referenced.com
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Rigel,

and thank you for the reply.

I've tried your example and it does auto fw however it does not seem to pass me values...

For example my page A has a form that looks like:

and page B

when i had these hidden values to pageA it was working now it does nearly whatI want but without sending those values.

Any suggestions??

Thank you in advance
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Silly me, Thnk you for all the replies.
The solution to my problem was this java script and to my former problem was that i Forgot to add /

thank you again

Pinda
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic