A possible bug in php .3.10 ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nandyal@gmail.com

    A possible bug in php .3.10 ?

    All,

    The following script works as intended in MS-Windows and in other Linux
    boxes, except on the one that runs php 4.3.10.
    Sorry for the long post.

    1) # uname -a
    Linux bubba 2.4.20 #5 SMP Thu Apr 3 12:26:19 BST 2003 i686 i686 i386
    GNU/Linux

    2) #php -v
    PHP 4.3.10 (cgi) (built: Mar 15 2005 14:36:32)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

    3) Here is the script :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Test form posting arrays - dynamic indexes</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
    />
    </head>
    <body>

    <form name="test" method="post" action="/status/test.php">
    <input type="text" name="test_text[]"><br />
    <input type="text" name="test_text[]"><br />
    <input type="submit" name="submit" value="Submit">

    </form>
    </body>
    </html>

    4) What this script is supposed to do - Show two fields on a web
    browser.
    But only on this specific server, it shows two fields, and if I input
    data it shows me an extra data field !!. As you can see below, I used
    the "View Page source" :

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    <html>
    <head>
    <title>Test form posting arrays - dynamic indexes</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
    />
    </head>
    <body>
    Array
    (
    [test_text] => Array
    (
    [0] => test
    [1] => this
    [2] => this <-- This is the error. Why is a third
    array
    showing up?
    )

    [submit] => Submit
    )

    <form name="test" method="post" action="/status/test.php">
    <input type="text" name="test_text[]"><br />
    <input type="text" name="test_text[]"><br />
    <input type="submit" name="submit" value="Submit">

    </form>
    </body>
    </html>

  • Andy Hassall

    #2
    Re: A possible bug in php .3.10 ?

    On 29 Mar 2005 12:04:51 -0800, nandyal@gmail.c om wrote:
    [color=blue]
    >The following script works as intended in MS-Windows and in other Linux
    >boxes, except on the one that runs php 4.3.10.
    >Sorry for the long post.
    >
    >3) Here is the script :[/color]
    [snip][color=blue]
    >
    >4) What this script is supposed to do - Show two fields on a web
    >browser.
    >But only on this specific server, it shows two fields, and if I input
    >data it shows me an extra data field !!. As you can see below, I used
    >the "View Page source" :
    >
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    >"http://www.w3.org/TR/html4/loose.dtd">
    >
    ><html>
    ><head>
    ><title>Test form posting arrays - dynamic indexes</title>
    ><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
    >/>
    ></head>
    ><body>
    >Array
    >(
    > [test_text] => Array
    > (
    > [0] => test
    > [1] => this
    > [2] => this <-- This is the error. Why is a third
    >array
    > showing up?[/color]

    You haven't posted the code that produces this output. The code you posted
    does not have any print statements, or anything that produces output.

    Or if you have, it's doubly bizarre as it would have to have magically
    inserted a "print_r" statement.

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • nandyal@gmail.com

      #3
      Re: A possible bug in php .3.10 ?

      Thanks Andy for helping out - Here is the script.

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">

      <html>

      <head>
      <title>Test form posting arrays - dynamic indexes</title>
      <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
      />
      </head>
      <body>
      <?php
      if (isset($_POST['submit'])) {
      print_r ($_POST);
      }
      ?>

      <form name="test" method="post" action="/status/test.php">
      <input type="text" name="test_text[]"><br />
      <input type="text" name="test_text[]"><br />
      <input type="submit" name="submit" value="Submit">

      </form>
      </body>


      Andy Hassall wrote:[color=blue]
      > On 29 Mar 2005 12:04:51 -0800, nandyal@gmail.c om wrote:
      >[color=green]
      > >The following script works as intended in MS-Windows and in other[/color][/color]
      Linux[color=blue][color=green]
      > >boxes, except on the one that runs php 4.3.10.
      > >Sorry for the long post.
      > >
      > >3) Here is the script :[/color]
      > [snip][color=green]
      > >
      > >4) What this script is supposed to do - Show two fields on a web
      > >browser.
      > >But only on this specific server, it shows two fields, and if I[/color][/color]
      input[color=blue][color=green]
      > >data it shows me an extra data field !!. As you can see below, I[/color][/color]
      used[color=blue][color=green]
      > >the "View Page source" :
      > >
      > ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      > >"http://www.w3.org/TR/html4/loose.dtd">
      > >
      > ><html>
      > ><head>
      > ><title>Test form posting arrays - dynamic indexes</title>
      > ><meta http-equiv="content-type" content="text/html;[/color][/color]
      charset=iso-8859-1"[color=blue][color=green]
      > >/>
      > ></head>
      > ><body>
      > >Array
      > >(
      > > [test_text] => Array
      > > (
      > > [0] => test
      > > [1] => this
      > > [2] => this <-- This is the error. Why is a[/color][/color]
      third[color=blue][color=green]
      > >array
      > > showing up?[/color]
      >
      > You haven't posted the code that produces this output. The code you[/color]
      posted[color=blue]
      > does not have any print statements, or anything that produces output.
      >
      > Or if you have, it's doubly bizarre as it would have to have[/color]
      magically[color=blue]
      > inserted a "print_r" statement.
      >
      > --
      > Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
      > <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis[/color]
      tool

      Comment

      • Andy Hassall

        #4
        Re: A possible bug in php .3.10 ?

        On 29 Mar 2005 15:30:33 -0800, nandyal@gmail.c om wrote:
        [color=blue]
        >Thanks Andy for helping out - Here is the script.
        >[/color]
        [snip]

        Works as expected for me on 4.3.10. More details about your PHP setup?

        --
        Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
        <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

        Comment

        • nandyal@gmail.com

          #5
          Re: A possible bug in php .3.10 ?

          Here is more info - Thanks again.

          I built the php as rpm from the sources - Here is the list of rpms
          [root@bubba root]# rpm -qa | grep -i php
          <== php rpms
          php-4.3.10-2.sp
          php-ldap-4.3.10-2.sp
          php-pgsql-4.3.10-2.sp
          php-pear-4.3.10-2.sp
          php-devel-4.3.10-2.sp
          php-imap-4.3.10-2.sp
          php-mbstring-4.3.10-2.sp
          php-odbc-4.3.10-2.sp
          php-xmlrpc-4.3.10-2.sp
          php-debuginfo-4.3.10-2.sp
          php-domxml-4.3.10-2.sp
          php-mysql-4.3.10-2.sp

          #php -v
          <== Version of php
          PHP 4.3.10 (cgi) (built: Mar 15 2005 14:36:32)
          Copyright (c) 1997-2004 The PHP Group
          Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

          #php -m
          <== List of modules in php.
          bcmath
          bz2
          calendar
          ctype
          curl
          dba
          dbx
          dio
          domxml
          exif
          ftp
          gd
          gettext
          gmp
          iconv
          imap
          ldap
          mbstring
          mysql
          ncurses
          odbc
          openssl
          overload
          pcre
          pgsql
          posix
          pspell
          session
          shmop
          sockets
          standard
          sysvsem
          sysvshm
          tokenizer
          wddx
          xml
          xmlrpc
          yp
          zlib

          Apache version
          [root@bubba root]# httpd -v <== apache Version
          Server version: Apache/2.0.40
          Server built: Feb 25 2003 05:01:56

          Php references in httpd.conf <== how php is
          called from apache
          [root@bubba root]# grep php /etc/httpd/conf/httpd.conf
          #AddModule mod_php.c
          #AddModule mod_php3.c
          #LoadModule php_module modules/mod_php.so
          #LoadModule php3_module modules/libphp3.so
          LoadModule php4_module modules/libphp4.so
          DirectoryIndex index.php index.html index.html.var
          #AddType application/x-httpd-php3 .php3 # for PHP 3
          AddType application/x-httpd-php .php
          <Files *.php>

          Php ini file. <== php ini
          file. Removed comments and DB

          related

          [PHP]

          engine = On
          short_open_tag = On
          asp_tags = Off
          precision = 14
          y2k_compliance = On
          output_bufferin g = Off
          zlib.output_com pression = Off
          implicit_flush = Off
          unserialize_cal lback_func=
          serialize_preci sion = 100
          allow_call_time _pass_reference = Off

          safe_mode = Off
          safe_mode_gid = Off
          safe_mode_inclu de_dir =
          safe_mode_exec_ dir =
          safe_mode_allow ed_env_vars = PHP_
          safe_mode_prote cted_env_vars = LD_LIBRARY_PATH

          disable_functio ns =
          disable_classes =
          expose_php = On

          max_execution_t ime = 30 ; Maximum execution time of each script, in
          seconds
          max_input_time = 60 ; Maximum amount of time each script may spend
          parsing request data
          memory_limit = 8M ; Maximum amount of memory a script may consume
          (8MB)

          error_reporting = E_ALL & ~E_NOTICE
          display_errors = On
          display_startup _errors = On
          log_errors = On
          log_errors_max_ len = 1024
          ignore_repeated _errors = Off
          ignore_repeated _source = Off
          report_memleaks = On
          track_errors = Off
          html_errors = On
          error_log = /etc/php.err

          variables_order = "EGPCS"
          register_global s = Off

          register_argc_a rgv = On
          post_max_size = 8M
          gpc_order = "GPC"

          magic_quotes_gp c = Off
          magic_quotes_ru ntime = Off
          magic_quotes_sy base = Off

          auto_prepend_fi le =
          auto_append_fil e =

          default_mimetyp e = "text/html"

          include_path =
          ".:/php/includes:/var/www/smarty/libs:/var/www//qaweb/lib"

          doc_root =

          user_dir =

          extension_dir = /usr/lib/php4

          enable_dl = On

          file_uploads = On
          upload_max_file size = 2M
          allow_url_fopen = On

          default_socket_ timeout = 60

          extension=domxm l.so
          extension=odbc. so
          extension=xmlrp c.so

          [Syslog]
          define_syslog_v ariables = Off

          [mail function]
          SMTP = localhost
          sendmail_path = /usr/sbin/sendmail -t -i

          [SQL]
          sql.safe_mode = Off


          [MySQL]
          mysql.allow_per sistent = On
          mysql.max_persi stent = -1
          mysql.max_links = -1
          mysql.default_p ort =

          mysql.default_s ocket =
          mysql.default_h ost =
          mysql.default_u ser =
          mysql.default_p assword =
          mysql.connect_t imeout = 60
          mysql.trace_mod e = Off

          [dbx]
          dbx.colnames_ca se = "lowercase"

          [bcmath]
          bcmath.scale = 0


          [Session]
          session.save_ha ndler = files
          session.save_pa th = /var/lib/php/session
          session.use_coo kies = 1
          session.name = PHPSESSID
          session.auto_st art = 0

          session.cookie_ lifetime = 0
          session.cookie_ path = /
          session.cookie_ domain =

          session.seriali ze_handler = php

          session.gc_prob ability = 1
          session.gc_divi sor = 1000
          session.gc_maxl ifetime = 1440

          session.bug_com pat_42 = 0
          session.bug_com pat_warn = 1

          session.referer _check =
          session.entropy _length = 0
          session.entropy _file =

          session.cache_l imiter = nocache
          session.cache_e xpire = 180

          session.use_tra ns_sid = 0

          url_rewriter.ta gs =
          "a=href,area=hr ef,frame=src,in put=src,form=fa keentry"


          [Sockets]
          sockets.use_sys tem_read = On

          Comment

          Working...