setting register_globals

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

    setting register_globals

    Hi,
    In the setting of my host, the variable register_global s is set to On,
    I like to set it to Off in my solution, is it possible?
    I've tried in my code: ini_set("regist er_globals","0" );
    but it doesn't work...
    Thanks for your help.


  • Joachim Mæland

    #2
    Re: setting register_global s

    On Wed, 21 Apr 2004 10:50:03 -0400, toufik toufik wrote:
    [color=blue]
    > In the setting of my host, the variable register_global s is set to On,
    > I like to set it to Off in my solution, is it possible?
    > I've tried in my code: ini_set("regist er_globals","0" );
    > but it doesn't work...[/color]

    It will work, if set in httpd.conf, php.ini or .htaccess

    It can't be set in user scripts...

    --
    mvh/regards
    Joachim Mæland

    If everything seems under control, you're just not going fast enough.
    -Mario Andretti

    Comment

    • Alvaro G Vicario

      #3
      Re: setting register_global s

      *** toufik toufik wrote/escribió (Wed, 21 Apr 2004 10:50:03 -0400):[color=blue]
      > In the setting of my host, the variable register_global s is set to On,
      > I like to set it to Off in my solution, is it possible?
      > I've tried in my code: ini_set("regist er_globals","0" );
      > but it doesn't work...[/color]

      In recent versions it is a per-host setting. Maybe you can change it in
      ..htaccess (that depends on general security settings):

      php_admin_flag register_global s off


      --
      --
      -- Álvaro G. Vicario - Burgos, Spain
      --

      Comment

      • toufik toufik

        #4
        Re: setting register_global s

        Thanks friends,
        But can you explain more, where to put this file? ist it .htaccess or
        xxxx.htaccess?
        can you please give me an example?

        Thanks

        "Alvaro G Vicario" <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> wrote in
        message news:bxirdynqjz nu$.1f5xj7o7nf0 st.dlg@40tude.n et...[color=blue]
        > *** toufik toufik wrote/escribió (Wed, 21 Apr 2004 10:50:03 -0400):[color=green]
        > > In the setting of my host, the variable register_global s is set to On,
        > > I like to set it to Off in my solution, is it possible?
        > > I've tried in my code: ini_set("regist er_globals","0" );
        > > but it doesn't work...[/color]
        >
        > In recent versions it is a per-host setting. Maybe you can change it in
        > .htaccess (that depends on general security settings):
        >
        > php_admin_flag register_global s off
        >
        >
        > --
        > --
        > -- Álvaro G. Vicario - Burgos, Spain
        > --[/color]


        Comment

        • Alvaro G Vicario

          #5
          Re: setting register_global s

          *** toufik toufik wrote/escribió (Wed, 21 Apr 2004 12:13:42 -0400):[color=blue]
          > But can you explain more, where to put this file? ist it .htaccess or
          > xxxx.htaccess?
          > can you please give me an example?[/color]

          It's a text file you put in any web folder and affects to that folder and
          its subfolders. You normally place it in your web root. File name is
          ".htaccess" (without quotes). Syntax is simple: one directive per line.

          --
          --
          -- Álvaro G. Vicario - Burgos, Spain
          --

          Comment

          • toufik toufik

            #6
            Re: setting register_global s

            Thanks,
            I've tried it, I can Upload but it gives me an internel error when I access
            my webSite in the browser

            I've tried 2 ways that I copied from the intenet

            1st way:
            <IfModule mod_php4.c>
            php_value register_global s "no"
            </IfModule>

            2nd way:
            php_admin_flag register_global s off

            can you please give me the exact syntax of the text inside this file

            Thanks.

            "Alvaro G Vicario" <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> wrote in
            message news:10whh0ji86 snn$.1xxqf1uav1 5pn$.dlg@40tude .net...[color=blue]
            > *** toufik toufik wrote/escribió (Wed, 21 Apr 2004 12:13:42 -0400):[color=green]
            > > But can you explain more, where to put this file? ist it .htaccess or
            > > xxxx.htaccess?
            > > can you please give me an example?[/color]
            >
            > It's a text file you put in any web folder and affects to that folder and
            > its subfolders. You normally place it in your web root. File name is
            > ".htaccess" (without quotes). Syntax is simple: one directive per line.
            >
            > --
            > --
            > -- Álvaro G. Vicario - Burgos, Spain
            > --[/color]


            Comment

            • Jan Pieter Kunst

              #7
              Re: setting register_global s

              In article <Atxhc.15777$CO 3.849591@news20 .bellglobal.com >,
              "toufik toufik" <toufiki@sympat ico.ca> wrote:
              [color=blue]
              > Thanks,
              > I've tried it, I can Upload but it gives me an internel error when I access
              > my webSite in the browser
              >
              > I've tried 2 ways that I copied from the intenet
              >
              > 1st way:
              > <IfModule mod_php4.c>
              > php_value register_global s "no"
              > </IfModule>
              >
              > 2nd way:
              > php_admin_flag register_global s off
              >
              > can you please give me the exact syntax of the text inside this file
              >
              > Thanks.[/color]

              This one works for me:

              <IfModule mod_php4.c>
              php_flag register_global s on
              </IfModule>


              JP

              --
              Sorry, <devnull@cauce. org> is een "spam trap".
              E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.

              Comment

              • toufik toufik

                #8
                Re: setting register_global s

                Sorry, doesn't work

                my host has the version php4.1.2...

                Any hint please??

                "Jan Pieter Kunst" <devnull@cauce. org> wrote in message
                news:devnull-5EABE6.19500521 042004@news1.ne ws.xs4all.nl...[color=blue]
                > In article <Atxhc.15777$CO 3.849591@news20 .bellglobal.com >,
                > "toufik toufik" <toufiki@sympat ico.ca> wrote:
                >[color=green]
                > > Thanks,
                > > I've tried it, I can Upload but it gives me an internel error when I[/color][/color]
                access[color=blue][color=green]
                > > my webSite in the browser
                > >
                > > I've tried 2 ways that I copied from the intenet
                > >
                > > 1st way:
                > > <IfModule mod_php4.c>
                > > php_value register_global s "no"
                > > </IfModule>
                > >
                > > 2nd way:
                > > php_admin_flag register_global s off
                > >
                > > can you please give me the exact syntax of the text inside this file
                > >
                > > Thanks.[/color]
                >
                > This one works for me:
                >
                > <IfModule mod_php4.c>
                > php_flag register_global s on
                > </IfModule>
                >
                >
                > JP
                >
                > --
                > Sorry, <devnull@cauce. org> is een "spam trap".
                > E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.[/color]


                Comment

                • Jan Pieter Kunst

                  #9
                  Re: setting register_global s

                  In article <QNyhc.17187$CO 3.861561@news20 .bellglobal.com >,
                  "toufik toufik" <toufiki@sympat ico.ca> wrote:
                  [color=blue]
                  > Sorry, doesn't work
                  >
                  > my host has the version php4.1.2...
                  >
                  > Any hint please??[/color]

                  There is an AllowOverride directive in Apache's central httpd.conf file
                  which sets what local .htaccess files are permitted to do. It could be
                  that the AllowOverride in the httpd.conf file is too restrictive.

                  JP

                  --
                  Sorry, <devnull@cauce. org> is een "spam trap".
                  E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.

                  Comment

                  • Alvaro G Vicario

                    #10
                    Re: setting register_global s

                    *** toufik toufik wrote/escribió (Wed, 21 Apr 2004 14:09:54 -0400):[color=blue]
                    > Sorry, doesn't work
                    >
                    > my host has the version php4.1.2...[/color]

                    Please note that this should not necessarily work for you, even in your
                    syntax is correct. You need that the server supports "php_admin_ flag
                    register_global s" for virtual hosts and you need that server admin gave
                    your host the appropriate permissions. I have a test server (Apache 1.3.27
                    + PHP 4.1.2) where this won't work at all, while in my production server
                    (Apache 2.0.40 + PHP 4.2.2) it works fine.

                    --
                    --
                    -- Álvaro G. Vicario - Burgos, Spain
                    --

                    Comment

                    Working...