not-off-topic - php advice? Redirecting users that have links to old cacti installation on another host

Lukasz Sokol <[email protected]>
Newsgroups gmane.network.cacti.user
Message-ID <[email protected]>
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.

Intended usage : inject into auth_login.php of a deprecated cacti installation
(told ya it's not off-topic) to provide a clickable link
(so far I managed to inject a big warning and hide off the login button,
but some automation would be much nicer)
SO now my login screen of the old cacti [host1] shows (I've edited html part in auth_login.php):

----->
This CACTI installation is deprecated. For functioning installation please use
https://host2/cacti
If you got here by using a fixed link, please substitute
host1 for host2 in the address bar.
<----

[The code I am looking to add would do this instead of the last 2 lines:]
Or click this link [https://host2/cacti/graph_view.php?action=tree&tree_id=24&leaf_id=164]

[the user has clicked on a link that read https://host_1_/cacti/graph_view.php?action=tree&tree_id=24&leaf_id=164 and such URL is shown in the browser]

[and YES I'd rather have users click on a link not have them automatically redirected]

[both the new and old cacti installations have same tree layouts as the new one is a clone of the old]
[oh and the host1 and host2 are actually IP addresses so, erm, numeric]

Sorry if the explanation is a bit too long ;)
L.


------------------------------------------------------------------------------
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.