473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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>

Jul 17 '05 #1
4 1706
On 29 Mar 2005 12:04:51 -0800, na*****@gmail.com wrote:
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 : [snip]
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?


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 / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
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:
On 29 Mar 2005 12:04:51 -0800, na*****@gmail.com wrote:
The following script works as intended in MS-Windows and in other Linuxboxes, except on the one that runs php 4.3.10.
Sorry for the long post.

3) Here is the script : [snip]

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 inputdata it shows me an extra data field !!. As you can see below, I usedthe "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 thirdarray
showing up?


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 / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis

tool

Jul 17 '05 #3
On 29 Mar 2005 15:30:33 -0800, na*****@gmail.com wrote:
Thanks Andy for helping out - Here is the script.

[snip]

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

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4
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_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = Off

safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH

disable_functions =
disable_classes =
expose_php = On

max_execution_time = 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_globals = Off

register_argc_argv = On
post_max_size = 8M
gpc_order = "GPC"

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

auto_prepend_file =
auto_append_file =

default_mimetype = "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_filesize = 2M
allow_url_fopen = On

default_socket_timeout = 60

extension=domxml.so
extension=odbc.so
extension=xmlrpc.so

[Syslog]
define_syslog_variables = Off

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

[SQL]
sql.safe_mode = Off
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =

mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[dbx]
dbx.colnames_case = "lowercase"

[bcmath]
bcmath.scale = 0
[Session]
session.save_handler = files
session.save_path = /var/lib/php/session
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0

session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =

session.serialize_handler = php

session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440

session.bug_compat_42 = 0
session.bug_compat_warn = 1

session.referer_check =
session.entropy_length = 0
session.entropy_file =

session.cache_limiter = nocache
session.cache_expire = 180

session.use_trans_sid = 0

url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeent ry"
[Sockets]
sockets.use_system_read = On

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Julia Briggs | last post by:
I am struggling to create a PHP function that would take a specified image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail so it will always fit in a 200x250 space. I am hoping...
36
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
7
by: Andrzej | last post by:
Is it possible to call a function which name is given by a string? Let assume that I created a program which call some functions for example void f1(void), void f2(void), void f3(void). ...
2
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
1
by: AAA | last post by:
hi, I'll explain fastly the program that i'm doing.. the computer asks me to enter the cardinal of a set X ( called "dimX" type integer)where X is a table of one dimension and then to fill it...
25
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
4
by: RSH | last post by:
Okay my math skills aren't waht they used to be... With that being said what Im trying to do is create a matrix that given x number of columns, and y number of possible values i want to generate...
7
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default...
14
by: bjorklund.emil | last post by:
Hello pythonistas. I'm a newbie to pretty much both programming and Python. I have a task that involves writing a test script for every possible combination of preference settings for a software...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.