php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34460 mysql_connect results in "Content is not allowed in prolog" in CSS validator
Submitted: 2005-09-11 05:59 UTC Modified: 2005-09-24 13:22 UTC
From: mnjul at mail2000 dot com dot tw Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.4.0 OS: Windows Svr 2003, Ent. Edi. TW
Private report: No CVE-ID: None
 [2005-09-11 05:59 UTC] mnjul at mail2000 dot com dot tw
Description:
------------
My PHP file has mysql_connect in the very beginning of the file. When I validate the php file for CSS validation using W3C's CSS validator, I get "Content is not allowed in prolog." error on Line 1, Column 1. The file can be found at http://61.59.59.53/test.php .

If I take out the mysql_connect function, the CSS validator validates the document successfully ( as you may see in http://61.59.59.53/test2.php ).

Incidentally, the file was not saved as Unicode/UTF-8, so there is no BOM issue :)

I downloaded php zip package (Windows Binaries) and the changes I made in php.ini were "cgi.force_redirect = 0" along with some SMTP settings, turning on php_mbstring.dll and php_iconv.dll extensions.

Reproduce code:
---------------
<?php
// these codes are in the very beginning of the php file
$h="localhost:myport"; // I changed my MySQL port and it's not 3306
$u="myusername";
$p="mypassword";
$r=@mysql_connect($h,$u,$p);
@mysql_close($r);

// <!DOCTYPE html... and the rest of HTML follow this ?>.
?>

Expected result:
----------------
The mysql_connect function should not result in "Content is not allowed in prolog." in W3C's CSS Validator, and W3C CSS Validator should validate the document sucessfully.

Actual result:
--------------
When validating http://61.59.59.53/test.php for CSS, W3C's CSS Validator gives this error:

Target: http://61.59.59.53/test.php
Please, validate your XML document first!
Line 1
Column 1
Content is not allowed in prolog.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-11 12:50 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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

.
 [2005-09-24 13:22 UTC] mnjul at mail2000 dot com dot tw
Additionally, this only happens when I set UTF8 as default charset for MySQL.

My MySQL was installed using 4.1.12 Essential MSI package.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC