display domain name instead of filename in php – PHP

  php

Q(Question):

How do I display main domain name instead of ip or filename in php? For example suppose I am redirected to file http://example.com/myfolder/test.htm, then instead of specified url I want to display example.com in the address bar for such url. How can it be done?

A(Answer):

Use ajax function. Then it will be in that same page.

A(Answer):

kindly tell me how to do that

A(Answer):

if you are having a menu in your example.com page, on click event just call ajax function then page will nor refresh and not redirect to requested page instead of that calling page(requested page ) will include in example.com page itself so in url we cannot see the path.
you can use ajax function in any event on mouseover or on click or anthywhere
–Ammu

A(Answer):

You could use an <iframe>, and load a specific page into it using Javascript.
You can’t, however, simply change the contents of the browser address bar. It will always show the address of the page it’s displaying.

A(Answer):

use mod rewrite, it will save your time

A(Answer):

simple format is to give the url as form action="example.com/myfolder/test.htm"

LEAVE A COMMENT