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

  1. #1

    Default Re: [PHP] host name

    >I want to get the current domain name in to a PHP variable.

    print_r() the contents of $_SERVER to see all the information given to you
    by the webserver -- the host name will be in there.

    ---------------------------------------------------------------------
    michal migurski- contact info and pgp key:
    sf/ca [url]http://mike.teczno.com/contact.html[/url]

    Mike Migurski Guest

  2. Similar Questions and Discussions

    1. CFMX on CF 5 host
      I am moving a website and I haven't messed with cold fusion and the code was written in CF MX and the host only has CF 5. I get this error. Just...
    2. CF ecommerce host ?
      I am going to be building an Ecommerce site and I was hoping some of you can suggest a good CF host that has a cart that I can customize very...
    3. OT: Asp.net host
      Hi Any recommendations for a good, reliable and responsive asp.net host in UK? Thanks Regards
    4. web host
      Pardon if this is off topic ... I am looking for a new web host that can get me in for less that $29.95 per month paid quarterly that also has...
    5. tar to other host
      Barry Margolin wrote: At layer 4, socket, it is the "shell" service rexecd "shell 514/tcp cmd". At layer 7, application, it is the rmt...
  3. #2

    Default Re: [PHP] host name

    <pre>
    <?print_r($_SERVER);?>
    </pre>

    Have a look at the output, find the variable you need, then manipulate
    it if needed.

    Justin French

    On Friday, August 15, 2003, at 01:32 PM, [email]viraj@ceynet.net[/email] wrote:
    > Hi all,
    > I want to get the current domain name in to a PHP
    > variable.
    >
    > This is the case..
    > I have a web site and four diferent domian names
    > pointing to that site. I want to redirect users from
    > the four domains to their specific home pages.
    >
    > eg: if a visitor from [url]http://domain1.com[/url] the header
    > should be passed to domain1.php, if the visitor from
    > [url]http://domain2.com[/url] the header hould be pass to domain2.php.
    >
    > thanks
    >
    > Viraj
    >
    >
    > --
    > PHP General Mailing List ([url]http://www.php.net/[/url])
    > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
    >
    > ---
    > [This E-mail scanned for viruses]
    >
    >
    Justin French Guest

  4. #3

    Default Re: [PHP] host name

    echo $HTTP_HOST;

    did the job perfectly

    thanks Justin

    Viraj



    Quoting Justin French <justin@indent.com.au>:
    > <pre>
    > <?print_r($_SERVER);?>
    > </pre>
    >
    > Have a look at the output, find the variable you need, then manipulate
    > it if needed.
    >
    > Justin French
    >
    > On Friday, August 15, 2003, at 01:32 PM, [email]viraj@ceynet.net[/email] wrote:
    >
    > > Hi all,
    > > I want to get the current domain name in to a PHP
    > > variable.
    > >
    > > This is the case..
    > > I have a web site and four diferent domian names
    > > pointing to that site. I want to redirect users from
    > > the four domains to their specific home pages.
    > >
    > > eg: if a visitor from [url]http://domain1.com[/url] the header
    > > should be passed to domain1.php, if the visitor from
    > > [url]http://domain2.com[/url] the header hould be pass to domain2.php.
    > >
    > > thanks
    > >
    > > Viraj
    > >
    > >
    > > --
    > > PHP General Mailing List ([url]http://www.php.net/[/url])
    > > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
    > >
    > > ---
    > > [This E-mail scanned for viruses]
    > >
    > >
    >
    >
    > --
    > PHP General Mailing List ([url]http://www.php.net/[/url])
    > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
    >
    >


    viraj@ceynet.net 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