Redirect a users to another page using PHP


You can use a simple PHP script to redirect a user from the page they entered to a different web page.
Using this method, they can be seamlessly transfered to the new page without having to click a link to continue.
Benefits:
  • Users are redirected quickly and seamlessly.
  • When using the ‘Back’ button, the user is taken to the last viewed page, not the redirect page.
  • Works on all browsers.

Coding:

<?php

header( ‘Location: http://www.yoursite.com/new_page.html&#8217; ) ;

?>

That’s all.. Check it..

How to redirect users after login in drupal?


Step 1 : Enable the trigger module if you haven’t done so. (To enable the trigger module, go to administer->site building->module. check the trigger module and press save.)

Step 2 : Go the administration panel and click on action. Under Make a new advanced action available, select Redirect to URL… and hit create.

Enter a description and the url to redirect to. You can use internal url like node/123 to redirect the user on login.

Press Save.

Step 3 : Go to the administration panel and click on triggers under site building. Select users in the tab.

Under Trigger: After a user has logged in, select the trigger you have just created and hit assign.

Logout and log back in to test.

Thanks!!