PHP Redirect Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark babli

    PHP Redirect Problem

    Hello everyone,

    If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to a
    php file, why is it that $_SERVER['HOST'] returns only the domain? I looked
    around on the internet and couldn't find that much of a help. What am I
    missing? Any help would be appreciated...



    Thanks





  • Jerry Stuckle

    #2
    Re: PHP Redirect Problem

    mark babli wrote:
    Hello everyone,
    >
    If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to a
    php file, why is it that $_SERVER['HOST'] returns only the domain? I looked
    around on the internet and couldn't find that much of a help. What am I
    missing? Any help would be appreciated...
    >
    >
    >
    Thanks
    >
    >
    >
    >
    >
    $_SERVER['HOST'] is not a valid value (at least not for Apache).

    If you're talking about $_SERVER['HTTP_HOST'] it is only supposed to
    return the domain (i.e. 'www.example.co m').

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Alvaro G. Vicario

      #3
      Re: PHP Redirect Problem

      *** mark babli escribió/wrote (Fri, 18 Aug 2006 18:03:24 GMT):
      If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to a
      php file, why is it that $_SERVER['HOST'] returns only the domain?
      That what a host is, a computer. It *must* be an IP address or domain name.
      In any case, you can get a list of $_SERVER values with:

      <?

      print_r($_SERVE R);

      ?>

      Find there whatever you need (I don't think "HOST" is in the list).



      --
      -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
      ++ Mi sitio sobre programación web: http://bits.demogracia.com
      +- Mi web de humor con rayos UVA: http://www.demogracia.com
      --

      Comment

      • mark babli

        #4
        Re: PHP Redirect Problem

        Thanks a million. I'll make sure to read what the return values are from now
        on... Newbie :-^

        "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
        news:5oudnTRmGc _nl3vZnZ2dnUVZ_ tydnZ2d@comcast .com...
        mark babli wrote:
        >Hello everyone,
        >>
        > If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to
        >a php file, why is it that $_SERVER['HOST'] returns only the domain? I
        >looked around on the internet and couldn't find that much of a help.
        >What am I missing? Any help would be appreciated...
        >>
        >>
        >>
        >Thanks
        >>
        >>
        >>
        >
        $_SERVER['HOST'] is not a valid value (at least not for Apache).
        >
        If you're talking about $_SERVER['HTTP_HOST'] it is only supposed to
        return the domain (i.e. 'www.example.co m').
        >
        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • mark babli

          #5
          Re: PHP Redirect Problem

          Thanks a million,

          That is exactly what I was looking for, I appreciate your help.
          "Alvaro G. Vicario" <webmaster@NOSP AMdemogracia.co mwrote in message
          news:80payd9vue uj$.1sf8e0d3osz y1.dlg@40tude.n et...
          *** mark babli escribió/wrote (Fri, 18 Aug 2006 18:03:24 GMT):
          > If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to
          >a
          >php file, why is it that $_SERVER['HOST'] returns only the domain?
          >
          That what a host is, a computer. It *must* be an IP address or domain
          name.
          In any case, you can get a list of $_SERVER values with:
          >
          <?
          >
          print_r($_SERVE R);
          >
          ?>
          >
          Find there whatever you need (I don't think "HOST" is in the list).
          >
          >
          >
          --
          -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
          ++ Mi sitio sobre programación web: http://bits.demogracia.com
          +- Mi web de humor con rayos UVA: http://www.demogracia.com
          --

          Comment

          • Andy Hassall

            #6
            Re: PHP Redirect Problem

            On Fri, 18 Aug 2006 20:59:46 +0200, "Alvaro G. Vicario"
            <webmaster@NOSP AMdemogracia.co mwrote:
            ><?
            ^^^

            Tsk tsk... you of course mean "<?php"

            ;-)

            --
            Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
            http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

            Comment

            • Alvaro G. Vicario

              #7
              Re: PHP Redirect Problem

              *** Andy Hassall escribió/wrote (Fri, 18 Aug 2006 23:02:15 +0100):
              >><?
              ^^^
              >
              Tsk tsk... you of course mean "<?php"
              >
              ;-)
              I hate fundamentalists so much :)


              --
              -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
              ++ Mi sitio sobre programación web: http://bits.demogracia.com
              +- Mi web de humor con rayos UVA: http://www.demogracia.com
              --

              Comment

              • mark babli

                #8
                Re: PHP Redirect Problem

                Ha............. ..... :-\
                "Alvaro G. Vicario" <webmaster@NOSP AMdemogracia.co mwrote in message
                news:1tbm4lkqee wgt$.cpp8ddqemg cf.dlg@40tude.n et...
                *** Andy Hassall escribió/wrote (Fri, 18 Aug 2006 23:02:15 +0100):
                >>><?
                > ^^^
                >>
                > Tsk tsk... you of course mean "<?php"
                >>
                > ;-)
                >
                I hate fundamentalists so much :)
                >
                >
                --
                -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
                ++ Mi sitio sobre programación web: http://bits.demogracia.com
                +- Mi web de humor con rayos UVA: http://www.demogracia.com
                --

                Comment

                • ctclibby

                  #9
                  Re: PHP Redirect Problem


                  mark babli wrote:
                  php file, why is it that $_SERVER['HOST'] returns only the domain? I looked
                  $_SERVER['HTTP_HOST'] would show you the alias, domain and top-level
                  domain ->
                  www is an alias to a computer or computers
                  domain is a ... domain
                  top-level domain is/are .com .net .edu .cc .us .... etc ... etc

                  print_r($Server ) works, but phpinfo(32) is easier to read IMO

                  todh

                  Comment

                  Working...