Archived

This topic is now archived and is closed to further replies.

  • 0

How to add redirection script in page?

Question

Posted · Report post

Hi, I need to add a redirection function in my Login Welcome page. I'm not a programming/coding person, and so have picked up a script for the same off the net. The script goes as follows (modified a bit for my site): <html> <head> <script type="text/javascript"> <!-- function delayer(){ window.location = "http://www.saplets.com" } //--> </script> </head> <body onLoad="setTimeout('delayer()', 5000)"> <h2>Welcome to Saplets!</h2> <p>Thank you for registering with Saplets! You will be redirected in 5 seconds.</p> </body> </html> Can anyone please tell me how and where to add the above code, so that i get a functional output of the same. All i know is that the Script part of it has to be added to the header section in Custom Code, but what about the Onload part?? Please help! Thanks, Rishi.

Share this post


Link to post
Share on other sites

6 answers to this question

Posted · Report post

Hi Adam, The function needs to execute only on the Login Welcome page, i.e. once a user has either registered or logged in. The onload event was added to the body in the script as i picked it off the source (on the net).

Share this post


Link to post
Share on other sites

Posted · Report post

Well, honestly i don't know exactly what you mean... There's this WP login for my Admin, and i've integrated s2Member with my site. So the plugin has taken control of the login page. Have created the two mandatory pages that the plugin needs, i.e. Login Welcome page and Membership Options page. I need the redirection script to be embedded into the Login Welcome Page. Hope that works! :)

Share this post


Link to post
Share on other sites

Posted · Report post

Is your log-in/register page set up already? How is it set up as part of your site (is it the WordPress user/subscriber/author type log-in)?

Share this post


Link to post
Share on other sites

Posted · Report post

Okay well normally javascript elements can be applied to the footer but did the plugin give you any other directions for this redirection?

Share this post


Link to post
Share on other sites

Posted · Report post

My site can be viewed here.

Share this post


Link to post
Share on other sites

Posted · Report post

The onload is actually applied to the body? or the function just needs execute onload?

Share this post


Link to post
Share on other sites