Re: not-off-topic - php advice? Redirecting users that have links to old cacti installation on another host
Matej Vadnjal <[email protected]>
| Newsgroups | gmane.network.cacti.user |
|---|---|
| Message-ID | <CANqhtAKh3Hg0vLZWH-KwqnkJdC22ub-pxi-gwankwatvTBobNA@mail.gmail.com> |
On Thu, Feb 9, 2012 at 10:40, Lukasz Sokol <[email protected]> wrote: > Hi, > my working knowledge of php is (unfortunately) very low, > but I'm looking for functions that would : > > - return current referrer url (or whatever is the address that is shown in the > addressbar of the browser called?) to a (string) variable > > - substitute part of that string with another (regex?) > > - write it out as string into the html section for usage in <a> tag as href and text. Look at $_SERVER["REQUEST_URI"]: http://php.net/manual/en/reserved.variables.server.php So something like: $loc = "http://<host2>" . $_SERVER["REQUEST_URI"]; print "<a href=\"$loc\">$loc</a>"; Kind regards Matej Vadnjal ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/