Wanting to display url on web page, but with a twist?!?

PHP coding talk.

Moderator: Moderators

Wanting to display url on web page, but with a twist?!?

Postby alexfirnigl on Wed Feb 28, 2007 5:45 pm

Hello all, this is my first post so I'm hoping someone can help.

I am wanting to display the url entered within the web page... which can be achive doing the following:

<?php
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
if (!empty($_SERVER["QUERY_STRING"]))
$url .= "?".$_SERVER['QUERY_STRING'];

echo"$url";
?>

So far so good!

The problem is that url entered is different to the acctual url it is on as its a redirection with a mask.

Hmmm can anybody help?
Ta very much

Alex
alexfirnigl
Registered User
Registered User
 
Posts: 3
Joined: Wed Feb 28, 2007 5:37 pm
Location: England

Postby PostBot on Wed Feb 28, 2007 6:10 pm

$_SERVER['REQUEST_URI']
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby alexfirnigl on Wed Feb 28, 2007 6:26 pm

Thanks for that very quick reply.
Its not quite what I mean.

I'll try an explain further:

User enters url eg www.a2zlondon.co.uk

when he enters that he is redirected to www.sales.thebigtune.com

This however is masked so that user sees url address as www.a2zlondon.com. It is this url that I want to display in main body of the page. Is this possible
Ta very much

Alex
alexfirnigl
Registered User
Registered User
 
Posts: 3
Joined: Wed Feb 28, 2007 5:37 pm
Location: England

Postby PostBot on Wed Feb 28, 2007 6:32 pm

Its a frameset, not redirect, so you can't do it because there isn't a way to get url of parent window in php. Windows are set on client side, not server side, so only JavaScript can get it (use top.document.location.href in javascript).
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby alexfirnigl on Wed Feb 28, 2007 6:50 pm

ok, will try that, thanks.

:D
Ta very much

Alex
alexfirnigl
Registered User
Registered User
 
Posts: 3
Joined: Wed Feb 28, 2007 5:37 pm
Location: England

Re: Wanting to display url on web page, but with a twist?!?

Postby maimai on Mon Nov 24, 2008 2:33 pm

The problem is that url entered is different to the acctual url it is on as its a redirection with a mask.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate
:D
maimai
Registered User
Registered User
 
Posts: 4
Joined: Mon Nov 24, 2008 2:17 pm


Return to PHP Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron