Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

How to convert small JavaScript Code to Perl!!?

Quote Reply
How to convert small JavaScript Code to Perl!!?
Greetings,
Can this REDIRECTION script be converted to perl so I can add it into my add_success.htm template to automatically direct the user to the right category after a successful link addition:

The script waits for 10 seconds, then load the right category page:

<meta http-equiv="refresh" content="10;URL=http://www.MyDomain.net/cgibin/links/page.cgi?g=<%ID%>%2F<%Category_ID%>%2Findex.php&d=1">


Thanks in advance
Mark
Quote Reply
Re: [Mark2] How to convert small JavaScript Code to Perl!!? In reply to
The redirection stuff could be done with;

print "Content-type: text/html \n\n";

...but I'm not sure about the 10 second delay Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Mark2] How to convert small JavaScript Code to Perl!!? In reply to
Why don't you add it as html into add_success - why do you need perl?
Quote Reply
Re: [Paul] How to convert small JavaScript Code to Perl!!? In reply to
Well! I have it already as javascript in the add_success.htm page. But if someone has his/her JavaScript disabled on the browser, then they will be stuck on the add_success.htm page.
I rather have it in perl, so it runs in the background.

Thanks
Mark
Quote Reply
Re: [Mark2] How to convert small JavaScript Code to Perl!!? In reply to
Code:
print $IN->redirect("http://www.MyDomain.net/cgibin/links/page.cgi?g=@{[$IN->param('ID')]}");

I've not tested but try that.

I don't think you can pause for 10 seconds though with $IN->redirect.
Quote Reply
Re: [Paul] How to convert small JavaScript Code to Perl!!? In reply to
Hummm!
I'll try this one, but could you please tell me how should I extract the number 90 from the CatLinks.CategoryID as if I use <%GT::Template::dump%> to display the tags on add_success.htm, I get the value of CatLinks.CategoryID equals to $VAR = ['90'];.
And what I am looking for is: how to get the number 90 only?

Thank you again
Mark