Gossamer Forum
Home : Products : Gossamer Links : Discussions :

redirecting after rate.cgi/deadlink.cgi etc.

Quote Reply
redirecting after rate.cgi/deadlink.cgi etc.
Someone is browsing through your site and sees a link they perhaps no or have seen before and click on the rate link. They then rate it and go to the thank you page. Now they are in a dead situation really and i think lots might just close their browser. What should happen? they should be redirected back to the page they were on before they got to rate.cgi

So the "thank you" page should come up with a ... thank you for rating sitename... you will be re-directed to the category listing in 30 seconds ...

how could this be done?

I imagine that on the thank you page we could get access to the category id and then re-direct based on that but we would not know which cat if the link was in more than 1.

A better way (and this is what vbulletin does when you register) is have something like:

www.domain.com/dir/rate.cgi?ID=45&return-url=http://www.domain.com/pages/Top/Blah

sort of thing but of course / are replaced by the code whatever it is meant to be.

This returnurl is then parsed through as a hidden variable from rate.cgi to thanks.html and then if returnurl != "" you are re-directed to it.

Make sense? any idea how? Would be very useful for a number of mods i would think from suggest to friend, rate, deadlink etc...

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
The "redirect in 30 seconds" is just a <meta-refresh> tag. (I forget the exact syntax).

But the best thing to do would be to send them to a custom page, with all the various things to do, and a message box in the middle that says "Thank you" or whatever message. They can then go on and continue browsing the site.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
How about.....

Create a new tag called <%redirect%> and value....

sub {

$go = $build_root_url;

return $go;

}

Then find the syntax for a meta refresh and where you'd put the URL, put <%redirect%>

That should work.

You can obviously change the url to what you want.

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
Paul, i don't think i understand that. I would need to do sometihng on link.html like www.domain.com/rate.cgi?ID=45&redirect=page

but then not sure how that tag would work?

Pugdog, that is perhaps true giving them the option but the problem still remains how to give them the option of getting back to where they started the process of say rating a link.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
Or you could pass the URL of the web page that they were in via the rate form...

Like the following:

1) Create a new global tag called referer...

Use $ENV{'HTTP_REFERER'} as its config.

2) Then in the rate.html and rate_error.html file, add the following hidden field:

Code:

<input type="hidden" name="referer" value="<%referer%>">


3) Then in the rate_success.html template file, simply add a link (or use the META refresh tag):

Code:

<a href="<%referer%>">Back to Previous Page</a>


Of course, there are other options like using the javascript history code with (-2) rather than (-1) to go back to the "previous" page...or provide a link back to the MAIN category where the link is found....

I have both available in my rate_success.html template file.


Regards,

Eliot Lee
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
Hi,

Use...

my $redirect = $IN->param('redirect');

return $redirect;

......as the code for the global tag and then use the meta refresh as I said.

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
thanks Eliot, that is PERFECT!

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
You're welcome.

Regards,

Eliot Lee
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
Eliot, have a slight problem.

The link back i am getting is the one to the page before, ie the rate.cgi page. This i think is because although the correct hidden variable is parsed along to rate_success when you ask it to display <%referer%> again, it just gives the referer of that page (ie rate.cgi) as opposed to the referer of rate.cgi (the category page)

So basically, how do i get the value from the rate.html template without having to edit the rate.cgi code to give access to another variable...

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
oh worked it out

just changed the rate.html code to referer2=<%referer%> and then on rate_success.html used <%refere2%>

that is cool how it can get all the parsed form variables automatically into the templates, very useful.

thanks again everyone.. sorry for being such a newbie but i'll get there!

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
Code:

<input type="hidden" name="anotherfieldname" value="<%referer%>">


Code:

<a href="<%anotherfieldname%>">Something</a>


Regards,

Eliot Lee
Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
can you write step by step instuctions for me on this.
I seem to be missing something, its not working.
I think its in the template global. regarding Use $ENV{'HTTP_REFERER'} as its config.

Quote Reply
Re: redirecting after rate.cgi/deadlink.cgi etc. In reply to
I've provided all the instructions you need. To create a global variable...search this forum for global tag since this has been covered before.

Good luck!

Regards,

Eliot Lee