is it possible to hide the paths on the address bar ?

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

is it possible to hide the paths on the address bar ?

Post by infolock »

I was wondering, is it possible to hide the files you are opening in the address bar ?

ie, instead of the address being displayed as http://www.bob.com/somedir/spiffy.php

could it be displayed as
http://www.bob.com/

In case there are any questions, this is saying I own the domain bob.com ( which I don't, but it's just an example... )

if this is possible, could someone point me in the right direction? Thanks
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

To get that effect you'd probably need frames.

Mac
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

oh, you mean setting up a frame for one page, and then upon clicking a link, changing that forms value to the one you are wanting to direct th em to, and then reloading the page ?

if so, is that possible to do within php, or is it only possible in html script.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Use Javascript. I am sure there is something for you at http://www.hotscripts.com :)

Alternatively - yes, frames are created by HTML, but administered by Javascript. There should a tutorial at http://www.webmonkey.com about frames :)
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

sweeeeeet, thanks
User avatar
r337ard
Forum Commoner
Posts: 29
Joined: Tue Apr 15, 2003 6:14 am
Contact:

Post by r337ard »

shouldn't using POST data and reafiles work too?

example:

Code: Select all

<?
switch ($_POST&#1111;'op'])&#123;
  case "page1":
    page1();
    break;
  case "page2":
    page2();
    break;
  default:
    index();
    break;
&#125;;

page1()&#123;
  readfile("./somedir/spiffy.php");
&#125;
page2()&#123;
  readfile("./somedir/biffy.php");
&#125;
index()&#123;
  //your index here
&#125;;
?>
as long as its post data it wont show in the main page, you wouldn't see the directory paths for the readfiles. is there some php taboo im breaking here?? or some security concern?
daisysf
Forum Newbie
Posts: 7
Joined: Tue Apr 08, 2003 4:13 am
Location: Pennsylvania

Any Other Ways?

Post by daisysf »

Is there any other ways of doing this, I'm thinking in the lines of META, Header() or HTTP, without javascript and frames?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

you could open a new broswer window with address bar turned off

Mark
daisysf
Forum Newbie
Posts: 7
Joined: Tue Apr 08, 2003 4:13 am
Location: Pennsylvania

Yes, but no

Post by daisysf »

Thats interesting, but I'd rather have the address bar with just the domain only for each page accessed.

I thought this might work, but it does not;

<meta name="Identifier-URL" content="http://www.Domain.Com">

I'm thinking maybe something in Header() or maybe;

$URL = $HTTP_HOST or $SERVER_NAME
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Just press F11 when the address bar is taken off, and it's back on. ;)
Image Image
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Easy answer, not really.

Opening up anew window wont work as a user easy can make it visible again.
Making it invincible in frames will be spotted viewing the source of the page.
header() will just redirect the user to a different page.

Require(), include(), readfile() might be an option, as you are displaying a file thats not on the same (i assume) location as the actual page being viewed...
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Easier answer: I'm pretty sure this is something that mod_rewrite can handle easily. I've never tried telling it to report that everything is just the root domain, but I can't think of a reason why it wouldn't work. Of course, if you're not on an Apache server you'll have to think up something else.

But I should mention: using frames is a terrible idea. Unless you're on an intranet or somesuch, or there's some very specific application of your site that I can't think of, the cost-to-benefit ratio of frames is horrible. People need to stop using them, circa three years ago.
Drachlen
Forum Contributor
Posts: 153
Joined: Fri Apr 25, 2003 1:16 am

Post by Drachlen »

A search of url cloaking finds:
"Q. What is URL cloaking?

--------------------------------------------------------------------------------
A.
It is where a user types in a domain name into their browser, but ends up at a different URL. This can be achieved through DNS settings for your domain name.

Importantly, unlike with URL forwarding , it is the domain name itself that is displayed in the browser bar, the destination URL is "cloaked" by the use of browser "frames".

This is an excellent technique to use in a variety of circumstances. For example you may want to hide an affiliate code or an overly long URL. However the method does have inheritent limitations. For example, if the URL being forwarded to is on a secure server, browsers won't be able to detect this and the padlock won't display."
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Drachlen
Forum Contributor
Posts: 153
Joined: Fri Apr 25, 2003 1:16 am

Post by Drachlen »

I found that iframe works a lot better, iframe is alot more compatable (to my knowledge) and doesnt require a bunch of files..

Try using this on the page you want it to always show up as:

<BODY TOPMARGIN=0 LEFTMARGIN=0>
<iframe FRAMEBORDER="0" width=100% height=100% src="Content.php" name="Content"></iframe>

Change that iframe the the main page of the page you want to show up, and it will always show up as that file in the url
Post Reply