ID: 11439
Updated by: jmoore
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: Scripting Engine problem
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

fixed in latest cvs. Thanks for your report.

Previous Comments:
---------------------------------------------------------------------------

[2001-06-12 12:30:07] [EMAIL PROTECTED]
****  ISSUE:

Comments are visible in the parsed output.

But, this is only happening when the script has it's lines separated by two carriage 
returns then a line feed (CR|CR|LF) (ASCII Ordinals: 13|13|10).  If the file has lines 
broken by one carriage return then a line feed, things run correctly.

This report may shed light on bug #11303, entitled "Comment Characters," submitted by 
another user on 5 June 2001:  http://www.php.net/bugs.php?id=11303

Here's how to recreate the problem...



****  STEP 1:

Point your browser to http://www.analysisandsolutions.com/code/sql/strange.php

This is the source code for that page, if you're interested...


<?php
header("Content-Type: text/plain; charset=ISO-8859-1");
?>
<?php echo "<?php"; ?>

#  Comment at TOP
echo "<html><head><title>Strange Behavior</title></head>n";
echo "<body><p>Echo at top</p>n";

<?php echo "?>"; ?>

<p>Some HTML in the middle.</p>

<?php echo "<?php"; ?>

# Comment near bottom.
echo "<p>echo near bottom</p>";

<?php echo "?>"; ?>

</body></html>




****  STEP 2:

Save the resulting output to your web server space.

Don't change the file name, file extension or the type of file.

I was using Netscape to view and save the file.
That may or may not be relevant.

FYI, here is a sample of the output.
Don't use this as the script in the next step.


<?php
#  Comment at TOP
echo "<html><head><title>Strange Behavior</title></head>n";
echo "<body><p>Echo at top</p>n";

?>
<p>Some HTML in the middle.</p>

<?php
# Comment near bottom.
echo "<p>echo near bottom</p>";

?>
</body></html>




**** STEP 3:

Now point your web browser to the copy of strange.php
you saved in your web space.

Then point browser to it and it results in...



#  Comment at TOP
# Comment near bottom.
<html><head><title>Strange Behavior</title></head>
<body><p>Echo at top</p>


<p>Some HTML in the middle.</p>



<p>echo near bottom</p>

</body></html>




****  NOTE:

All of the comments are pushed to the beginning of the
program and then displayed.  Ouch!


---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11439&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to