asklingo Posted January 1, 2008 Share Posted January 1, 2008 Hello all, How do we read addressbar with php? I know what to do but I can not figure out how. I have links in a webpage. I want to direct these pages to another page of mine with two frames. One containing Ads and the other containing the "real target" of the link which is an external page. For example if the link is to yahoo, after clicking the link,on the target window, there will be two frames (or tabel whatever).On the left, I want to display Ads and on the right, the content of yahoo. After clicking something in yahoo, whole window is to be used, so I dont want to use frames. Does anyone has an idea on how to do this with? Can it be getting the address from address bar something like something.php?www.yahoo.com ??? Quote Link to comment https://forums.phpfreaks.com/topic/83995-php-read-address-bar/ Share on other sites More sharing options...
chantown Posted January 1, 2008 Share Posted January 1, 2008 I don't get what you're trying to do, but if you want to get the URL that you see on the address bar currently, you can use $_SERVER['REQUEST_URI']. try that, or some $_SERVER variable. Quote Link to comment https://forums.phpfreaks.com/topic/83995-php-read-address-bar/#findComment-427425 Share on other sites More sharing options...
asklingo Posted January 1, 2008 Author Share Posted January 1, 2008 Sorry if I was not clear. What I want in the final page is; Address bar : http://www.something.com/links.php?www.yahoo.com Browser Window will contain two parts. These two parts maybe 20% left and 80% right. One will have some Advertisment and the other part will contain yahoo.com contents. When someone visiting this page clicks a link at yahoo, whole browser window will be used. thnx Quote Link to comment https://forums.phpfreaks.com/topic/83995-php-read-address-bar/#findComment-427429 Share on other sites More sharing options...
chantown Posted January 1, 2008 Share Posted January 1, 2008 You can $_GET the destination. http://www.something.com/links.php?destination=www.yahoo.com then load destination to the right frame and Ad on left(i dont know how to use frames, that was N years ago) "When someone visiting this page clicks a link at yahoo, whole browser window will be used." I don't think this is possible, because if someone clicks on yahoo's link, it's THEIR website (they choose whether to break out of frames). but there may be a way other experts here may know how to manipulate that Quote Link to comment https://forums.phpfreaks.com/topic/83995-php-read-address-bar/#findComment-427435 Share on other sites More sharing options...
asklingo Posted January 1, 2008 Author Share Posted January 1, 2008 thnx I tried <?php echo "<iframe src ='".$_GET["a"]."' width='100%' height='800'></iframe>"; ?> and it worked. I still could not find something to target to whole window. Quote Link to comment https://forums.phpfreaks.com/topic/83995-php-read-address-bar/#findComment-427450 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.