|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-11-23 16:49 UTC] kreny at dalouis dot com
Description:
------------
1. Configure line of my PHP 4.3.4
***************************************
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-apache2=/usr/local/apache2' '--with-mysql=/usr/local/mysql' '--enable-force-cgi-redirect' '--with-zlib' '--with-jpeg-dir' '--with-png-dir' '--with-freetype-dir' '--with-gd' '--with-mcrypt=/usr/local/lib' '--enable-bcmath'
2. Changes of my php.ini
***************************************
asp_tags = On
safe_mode = Off
disable_functions = system exec
default_charset =
session.name = D
session.cookie_domain =
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.1.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.1.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
3. Information of MySQL
MySQL Support enabled
Client API version 4.0.13
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE -I/usr/local/mysql/include
MYSQL_LIBS -L/usr/local/mysql/lib -lmysqlclient
4. Description:
***************************************
Because I want to log the accesses to the authenticating page of my site I created a table named ??log_access?? in MySQL which had a structure like below:
??
CREATE TABLE `log_access` (
`id` int(7) unsigned NOT NULL auto_increment,
`ip` varchar(16) NOT NULL default '',
`access_time` varchar(14) NOT NULL default '',
`sql_access_time` datetime NOT NULL default '0000-00-00 00:00:00',
`hostname` varchar(35) default NULL,
`times` int(10) NOT NULL default '0',
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM AUTO_INCREMENT=138 ;
??
I also built a function called Create_Log_Access(), saved in an extral file named fun_log.inc.php, which can return a log_access-SQL-query.
In my authenticating page which I request user to enter the username and password, I added such three lines like below to run Create_Log_Access():
??
require("./myadmin/connect.inc.php"); // Connection to MySQL
require_once("./myadmin/fun_log.inc.php"); // Include the funtion.
$query_log_access = Create_Log_Access();
mysql_query($query_log_access);
mysql_close();
??
This can be done even if a user does nothing but just access the authenticating page. And if the user is accepted, this page will redirect the user to another page which named user.php by using the script
header('Location: user.php');
. And of course I didn??t add any scripts that can include or can run the Create_Log_Access() in my other pages except the authenticating page.
Problem: But I still found the number in my table ??log_access?? is increasing when I access some other pages even if in which I only use pure html scripts. I cut any html scripts which will not effect the wrong result and finally found that the script in the line below result the problem.
<img src="" width="6" height="6" alt="" hspace="0" vspace="0" border="1" style="background-color: #617EBA">
This is a script which can display a colorful square in my page just for beauty. But when I delete the src="" part, everything return to normal -- the number in the table will not increase.
So I am wondering whether it is a bug of PHP or something else because this happened after I just updated the PHP from 4.3.2 to 4.3.4.
Thank you.
Reproduce code:
---------------
http://www.s.fpu.ac.jp/t-yuan/php4.3.4_bug.htm
Expected result:
----------------
Do not do any counting in my 'log_access' table.
Actual result:
--------------
Do the counting in my 'log_access' table.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 17:00:01 2025 UTC |
Hello, I got a very similar issue. Decription : 1. On my first page, I included a "write logfile" instructions such as : ---------------------------------------------------- if (@$file_stat=fopen('../stat/stat.txt, 'a')) { $p_stat = fputs($file_stat, 'pageview=1 and so on; '); fclose($file_stat); } 2. On another page it appears I had a broken image Although my "write logfile" instruction does exist only in first page, when loading the second one, the stat logfile was incremented ! Furthermore, in case the broken image was located in first page, then the logfile were incremented twice at each request of the page ! Explanation : ------------- I must say I took several hours to understand the logic behind :) Actually, it was a very easy issue :( My first page is set up as the default target for Error 404 redirection, that is the reason why all broken items (even images) perform a request to it ... and then increment my logfile :) That's it :) You can easily check it by logging the $REQUEST_URI (At that way you will get the name of the original requested item :) Also, this is a way to track the broken links. Isn't it ? Regards.I have the same problem with <SCRIPT> and src= Here is what I found (This is block of one my class): The following code didn't work: foreach($this->addJS as $srcLocation) { $head .= '<script src="'.$srcLocation.'" />'; } But the following works fine: foreach($this->addJS as $srcLocation) { $head .= '<script src="'.$srcLocation.'"></script>'; } In the beginning, I thought that the problem is with the way I close the SCRIPT element, but the following works too (I just remove forech loop): $head .= '<script src="'.$srcLocation.'" />'; If instead src= I write sra= it works(I mean didn't crash), also if I write srca= instead src= it works too. So now I think that it's a bug, some kind of conflict between src= and foreach loop, something internally may be. I try this without classes and the problem is the same, it's not in the class context. Best Regards! Stanislav Yordanov