php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30803 Function Repeat Twice
Submitted: 2004-11-16 01:39 UTC Modified: 2004-11-18 13:16 UTC
From: icui at email dot it Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.9 OS: Linux 2.6.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: icui at email dot it
New email:
PHP Version: OS:

 

 [2004-11-16 01:39 UTC] icui at email dot it
Description:
------------
The following script generates two files copies. 

The same script executed without Apache works properly and generates single file copy.

With $URL_CSS_ defined works properly. (row 13)

Deleting row 15 works properly.

Apache seems to execute twice the script, second in background. I don't understand why.


Tested with:
Php 5.0.1 - 4.3.9 - 4.3.4 
On Linux System kernel 2.4, 2.6


NB. In Windows seems to work properly. (not tested personally)


Reproduce code:
---------------
<?
$id       = uniqid('bug');
$wrk_dir  = '';                     // Working Directory
$src_file = 'grab.jpg';             // Source File
$dst_file = 'tmpgrab_'.$id.'.jpg';  // New File

echo 'Source File      ='.$src_file.'<br />';   // Print Source File Name
echo 'Destination File ='.$dst_file.'<br />';   // Print Destination File Name

if (!copy($wrk_dir.$src_file, $wrk_dir.$dst_file)) {
           echo 'Failed to copy.<br />';
}
//$URL_CSS_='string';
?>
<link rel="stylesheet" href="<?=$URL_CSS_?>" type="text/css" />

Expected result:
----------------
I expect that a new file is created in my $wrk_dir

Actual result:
--------------
Script generates two copies from original file.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-16 08:34 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.
 [2004-11-17 11:55 UTC] icui at email dot it
I reproduce this problem in another way. 
It's possible there is a problem in php module? 

Run following two pages in your system and see apache log file.
On linux system. 

---------------
filename

content
---------------


----------------------------------------
page.htm

<img src="" alt="No source specified" />
----------------------------------------


----------------------------------------
page.php

<img src="" alt="No source specified" />
----------------------------------------


htm extension: page run properly, once.
log: 
192.168.1.2 - - [17/Nov/2004:00:44:17 +0100] "GET /bug/page.htm HTTP/1.1" 200 41


php extension: page run twice.
log:
192.168.1.2 - - [17/Nov/2004:00:44:27 +0100] "GET /bug/page.php HTTP/1.1" 200 41
192.168.1.2 - - [17/Nov/2004:00:44:27 +0100] "GET /bug/page.php HTTP/1.1" 200 41


If you specify src, page works properly. 
I'm not sure that it's a php bug (apache2 related), apache bug or nothing of all that.


Thanks for your interest.
 [2004-11-17 14:55 UTC] icui at email dot it
Hi, 

two GET in log files.... 
It's a browser problem, sorry for the mistake and thanks for your interest.

Bye!
 [2004-11-18 08:40 UTC] derick@php.net
It is not a browser mistake, it is supposed to retrieve the same url when an empty one is passed to img src="".
 [2004-11-18 13:16 UTC] icui at email dot it
I finally understood the problem posting on newsgroup and forum. Now I'm trying to understand if its behaviour is correct; other browsers (opera & iexplorer e.g.) don't send multiple "GET" requests to the current page if there's <img src="">

...but I'm fallin' in off-topic now, I don't want to abuse of your kindness. ;)

thankyou very much!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC