I have the following snippet but does not seem to work when I try to redirect to referer page:
<?php echo url($_SERVER["HTTP_REFERER"], array('absolute' => true, 'external' => true)); ?>

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dtolj created an issue. See original summary.

saradaprasad17’s picture

Assigned: Unassigned » saradaprasad17
Status: Active » Needs review
FileSize
151.74 KB

Hi,
Found the solution for the issue . put this code in the php code area. it will redirect to the specified url.
Note : We need to enable the PHP Filter Module . Find the screenshot .

$url = "http://www.drupal.org";
return $url;
dtolj’s picture

It doesn't seem to work with $_SERVER["HTTP_REFERER"] but hard-coded urls work. any idea why?

 $url = $_SERVER["HTTP_REFERER"];
return $url; 
sano’s picture

Component: Code » Miscellaneous
Assigned: saradaprasad17 » Unassigned
Status: Needs review » Fixed

The solution recommended by @dtolj works. Make sure you do not have any Rules defined that would interfere with your Login Destination rule.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.