legohead6 Posted June 22, 2007 Share Posted June 22, 2007 i need to get the address path of my page as a variable, it changes depending on the id and settings of user so i cant make it a fixed one. how do i do this. Link to comment https://forums.phpfreaks.com/topic/56793-getting-whats-its-in-the-address-bar-as-a-variable/ Share on other sites More sharing options...
teng84 Posted June 22, 2007 Share Posted June 22, 2007 use $_SERVER['DOCUMENT_ROOT']; you can have the location of your site there^^ but if you mean get the value of somethng in the url use the $_GET['ure desired variable here'] sample: http://www.ASTIG.com/page.php?id=ASTIG then use $_GET['id']; so you will have the ASTIG as the value Link to comment https://forums.phpfreaks.com/topic/56793-getting-whats-its-in-the-address-bar-as-a-variable/#findComment-280553 Share on other sites More sharing options...
legohead6 Posted June 22, 2007 Author Share Posted June 22, 2007 no thats what i wanted, thanks, i need to copy all the get varibles set over, but there could be different ones set depending on settings and stuff, so i though just explode at the question mark and then add in. Link to comment https://forums.phpfreaks.com/topic/56793-getting-whats-its-in-the-address-bar-as-a-variable/#findComment-280555 Share on other sites More sharing options...
teng84 Posted June 22, 2007 Share Posted June 22, 2007 sorry but blurred question ??? any way you can have this id=ASTIG&id2=ASTIG&id3=ASTIG "it changes depending on the id and settings of user so i cant make it a fixed one" u can also use session on that^^^ Link to comment https://forums.phpfreaks.com/topic/56793-getting-whats-its-in-the-address-bar-as-a-variable/#findComment-280564 Share on other sites More sharing options...
ToonMariner Posted June 22, 2007 Share Posted June 22, 2007 either the $_GET super global or the $_SERVER['REQUEST_URI'] or $_SERVER['QUERY_STRING'] Link to comment https://forums.phpfreaks.com/topic/56793-getting-whats-its-in-the-address-bar-as-a-variable/#findComment-280569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.