PHP Command/Code to work out where its being accessed/run from?

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default PHP Command/Code to work out where its being accessed/run from?

    Hi,

    Is there a simple way to work out where the code is being run from?

    For example, you goto [url]www.mydomain5.co.uk[/url], when the index.php is run, it
    knows you are accessing [url]www.mydomain5.co.uk[/url] and stores the information
    accordingly, so that you could do :-


    $hostdomain = $_getmydomain (obviously this isnt the correct command name)
    echo"Thanks for visiting ".$hostdomain."<br>";


    for example?


    Thanks, Mark


    Mark Guest

  2. Similar Questions and Discussions

    1. Programing code for the Reset Page Origin command
      Does anyone know the code for the Reset Page Origin command so I can either add it to an action or include it in a script? Actions do not accept...
    2. Msg command doesn't work with AT scheduler
      Hello~. I made batch file, "eventlog.bat" to read 2003 server event automatically in my desktop. following batch file runs well when I click...
    3. DataGrid Command Doesn't work
      Hi, I have this column in my DataGrid: <asp:ButtonColumn DataTextField="site_name" HeaderText="Name" CommandName="Select1"> <ItemStyle...
    4. What code would I use to ensure a page is accessed by another within my site?
      I'm trying to prevent "leeching"..so that users must enter my site to get to the files. Does anyone know a script that will work? Thanks a...
    5. Using 'Shell' command in code.
      Hi, Has anyone had a problem using a 'Shell' command within code for webservice method? Are there any premission settings that allow/prohibit this?...
  3. #2

    Default Re: PHP Command/Code to work out where its being accessed/run from?

    On Wed, 13 Oct 2004 13:05:32 GMT (more or less), "Mark"
    <mark_news@horsemad.co.uk> wrote:
    >Hi,
    >
    >Is there a simple way to work out where the code is being run from?
    >
    >For example, you goto [url]www.mydomain5.co.uk[/url], when the index.php is run, it
    >knows you are accessing [url]www.mydomain5.co.uk[/url] and stores the information
    >accordingly, so that you could do :-
    >
    >
    >$hostdomain = $_getmydomain (obviously this isnt the correct command name)
    >echo"Thanks for visiting ".$hostdomain."<br>";
    >
    Create a page with

    <? phpinfo() ?>

    and you'll see the variables available to your scripts.


    Steven Stern Guest

  4. #3

    Default Re: PHP Command/Code to work out where its being accessed/run from?

    "Mark" <mark_news@horsemad.co.uk> wrote in message
    news:wK9bd.941$8r6.671@newsfe5-gui.ntli.net...
    > Hi,
    >
    > Is there a simple way to work out where the code is being run from?
    >
    > For example, you goto [url]www.mydomain5.co.uk[/url], when the index.php is run, it
    > knows you are accessing [url]www.mydomain5.co.uk[/url] and stores the information
    > accordingly, so that you could do :-
    >
    >
    > $hostdomain = $_getmydomain (obviously this isnt the correct command
    name)
    > echo"Thanks for visiting ".$hostdomain."<br>";
    >
    >
    > for example?
    As stated in the other post, see phpinfo().

    However, you should also remember that you shouldn't do anything to rely to
    heavily on this information. It can be spoofed quite easily at most sites.
    Simply adding a proper intery in the hosts file in Windows, for instance,
    will allow me to access just about any site I want using any domain name I
    want. Navigation within that site may or may not continue to use my spoofed
    domain name depending upon how the site was constructed.

    - Virgil


    Virgil Green Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139