Jump to content


Photo
- - - - -

How to add redirection script in page?


This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1 saplets

saplets

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 21 January 2011 - 01:10 PM

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.

#2 saplets

saplets

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 21 January 2011 - 01:12 PM

My site can be viewed

Please Login or Register to see this Hidden Content



#3 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 21 January 2011 - 06:48 PM

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

#4 saplets

saplets

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 22 January 2011 - 05:24 AM

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).

#5 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 22 January 2011 - 02:56 PM

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)?

#6 saplets

saplets

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 24 January 2011 - 05:27 AM

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! :)

#7 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 24 January 2011 - 06:20 PM

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