PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 9th, 2000, 12:22 PM
Metus Mortuus Metus Mortuus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 18 Metus Mortuus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've been twisting my mind trying to figure out how to get the real URL. I have a page at namezero which requires you to have a frame_banner at the bottom of the page, thus making it impossible to enter direct URL-adresses. E.g. http://www.metusmortuus.net and http://www.metusmortuus.net/samples.html will both end up at the same page, namely the page that this virtual domain is pointing to. (I hope you understand this)
What I need is to find the actual URL that was typed into the 'location'-box. Then I would be able to simply redirect my visitors to that page manually. (Yikes, this was hard to describe, but I hope you get the picture)

None of the predefined variables listed in phpinfo() worked (incl. request_uri and http_referrer), so I guess this is a long shot...

Reply With Quote
  #2  
Old July 9th, 2000, 02:05 PM
ledjon
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I understand what you mean, and I think I could do it with perl (cgi), but I'm not that versed in PHP to do tricks like that.

Reply With Quote
  #3  
Old July 9th, 2000, 02:48 PM
djcooper djcooper is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 3 djcooper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to djcooper
Try using the $HTTP_HOST function, eg

<?php

echo $HTTP_HOST;

?>

Coopers http://www.phatwap.co.uk

Reply With Quote
  #4  
Old July 10th, 2000, 08:04 AM
scollo scollo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 1999
Posts: 114 scollo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 44 sec
Reputation Power: 15
Use a combination of the variables $HTTP_HOST, $PHP_SELF, and $QUERY_STRING

http://www.php.net/manual/language.....predefined.php


Or use parse_url():

http://www.php.net/manual/function.parse-url.php

[This message has been edited by scollo (edited July 10, 2000).]

Reply With Quote
  #5  
Old July 10th, 2000, 02:27 PM
Metus Mortuus Metus Mortuus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 18 Metus Mortuus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Like I said, none of the variables listed in phpinfo() works... incl. http_host, phpself etc. etc... The HTML file itself resides on a different server, and what I need is the virtual URL... I really don't think it's possible :-(

Reply With Quote
  #6  
Old July 10th, 2000, 04:24 PM
SJONdaMON SJONdaMON is offline
PHP Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Location: EU.NL
Posts: 10 SJONdaMON User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You could try it with JavaScript, but I think you'll get access-errors...
I've got a similar situation myself, but haven't addressed the problem yet.
I'll try to come up with something later this week, and if it works, I'll post a solution here...



------------------
Have Fun !

SJONdaMON
SDO

Reply With Quote
  #7  
Old July 11th, 2000, 09:28 AM
ledjon
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Try REQUEST_URI. I this should be the URI that the visitor typed in.

Reply With Quote
  #8  
Old July 11th, 2000, 11:02 AM
Metus Mortuus Metus Mortuus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 18 Metus Mortuus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
To explain this a little further. My page is loaded inside a frame (classic URL cloaking) and the frame belongs to the providers of the Domain-forwarding-provider. So request_url would work in the frame (which I don't have access to), but not in my page (which reflects the server that the file is actually stored at)

That's why this seems hopeless, but the URL remains in the location window (where you type in URL's) so I'm wondering if it's possible to get it in any other way. Like I said 2 times allready, none of the variables in phpinfo() works (which includes all suggestions so far)

Reply With Quote
  #9  
Old July 11th, 2000, 11:10 AM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
OKay, well here's a thought, if you are working with a framed document and you want to preven access to a specific frame etc, why not try checking http referrer, look for whatever url you are after.. parse_url() can be set to readily check the referrer, for the specific, if it doesn't match bounce them with a header() call to whatever url you want them to enter from.

in short, for using http referrer you grab their referrer, and then point them to the main page "if" the referrer doesn't match that page.. etc.

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
  #10  
Old July 11th, 2000, 05:31 PM
jamnbryan jamnbryan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 12 jamnbryan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm kinda confused here but maybe this is what your looking for. I'm under the impression you want to get rid of the banner advertisement, so why not use javascript? Just add this code under <./head> [i put the period in case this strips out HTML]...

<script language="javascript">
<!--
if (top.frames.length != 0)
{
top.location=document.location
}
//-->
</script>

That will reload your page in the window, and you wont have the frames...

Hopes thats helps...
-Bryan

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > How to get the "real" URL?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap