#34460 [NEW]: mysql_connect results in "Content is not allowed in prolog" in CSS validator
| From: | mnjul at mail2000 dot com dot tw | Date: | Sun, 11 Sep 2005 03:59:56 +0000 |
| Subject: | #34460 [NEW]: mysql_connect results in "Content is not allowed in prolog" in CSS validator | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-84858@lists.php.net to get a copy of this message | ||
From: mnjul at mail2000 dot com dot tw
Operating system: Windows Svr 2003, Ent. Edi. TW
PHP version: 4.4.0
PHP Bug Type: MySQL related
Bug description: mysql_connect results in "Content is not allowed in prolog" in CSS
validator
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.
--
Edit bug report at http://bugs.php.net/?id=34460&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34460&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34460&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34460&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34460&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34460&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34460&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34460&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34460&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34460&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34460&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34460&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34460&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34460&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34460&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34460&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34460&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34460&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34460&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34460&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34460&r=mysqlcfg