Forum Moderators: coopster & phranque

Message Too Old, No Replies

Formmail redirect question

redirect to same page

         

Visit Thailand

12:20 pm on Apr 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using a fommail redirect I would like to redirect users to the same page upon submit .

However I want the script to redirect to the page it submitted from rather than a predefined url as the script will be on thousands of pages, so I cannot manually add the url each time.

Currently I am just using the simple:

<input type=hidden name="redirect" value="mydomain/mypage.shtml">

Also I would like if possible to create a pop up on submit to say thanks.

Any ideas?

Visit Thailand

12:03 am on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Any ideas please?

lexipixel

2:03 am on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You should be able to catch the $ENV value for referer and work with that.

lexipixel

2:15 am on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For the pop-up, you'll probably want to use Javascript. Since you're in the Perl forum, I assume you plan to use perl... so the basic idea is to encode the javascript into the perl script.

Here's one way it could be done:

1. encode link to "form generator" script in desired pages, (or in script if pages are dynamic).

2. user clicks link, Perl script generates form on the fly with $ENV('HTTP_REFERER') stuffed in a hidden field. (This will be passed back one more time so user can be returned to original page when form submission is complete).

3. User complete form and clicks submit.

4. Form data is sent to script (which has javascript coded into it that performs the pop-up "thank you" window). Users clicks "Close Window" which, via Javascript returns them to original page (which the script has been passing as HIDDEN data since the first click).

Another way it could be done is with IFRAME or FRAME tags... that way you could direct the desired actions to happen in named portions of the screen.

lexipixel

12:34 am on May 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For the Javscript portions of this solution, see:

[webreference.com...]

.