Ajith
Ajith

Reputation: 305

Redirecting to another page

I am building a website using joomla. In this site when a user request any page of my site, he should be redirected to disclaimer page. In disclaimer page a form is present. After submiting email, captcha when user press submit, he should be redirected to previously requested page.

Then the disclaimer page shouldn't appear when user browsing other pages of site.

How to remember the requested url user entered, so that on pressing submit, he is redirected there?

Upvotes: 0

Views: 160

Answers (2)

manuel-84
manuel-84

Reputation: 2938

have you tried this?

<?php
  $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
  $this->setRedirect($url);
?>

Upvotes: 1

Irfan
Irfan

Reputation: 7059

Try JURI::current() it will give you the current url.Add this as a parameter to url when you redirect to disclaimer page and than use this there.

more about JURI

Upvotes: 2

Related Questions