display domain name instead of filename in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Noorain
    New Member
    • Mar 2008
    • 57

    display domain name instead of filename in php

    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?
  • Ammu
    New Member
    • Aug 2011
    • 78

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

    Comment

    • Noorain
      New Member
      • Mar 2008
      • 57

      #3
      kindly tell me how to do that

      Comment

      • Ammu
        New Member
        • Aug 2011
        • 78

        #4
        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

        Comment

        • helimeef
          New Member
          • Sep 2007
          • 77

          #5
          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.

          Comment

          • johny10151981
            Top Contributor
            • Jan 2010
            • 1059

            #6
            use mod rewrite, it will save your time

            Comment

            • ditditsasa
              New Member
              • Mar 2012
              • 17

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

              Comment

              Working...