Wednesday, January 6, 2010

strange php/doctype bug

i was just spending the last few hours making a simple php template to use for websites when i came across a real strange bug. my template basically echos out the code for the document head, body and footer and inserts custom html in the middle somewhere.

now whenever i echoed out the head section with any doctype in it and any linebreaks, it put a space as the first character in the document, even though the source code was perfect.

i tried all kinds of str_replace on various hidden characters, \n, \r\n, \t etc. but to no avail. in the end i resorted to fixing it with css. i could have just had the entire head section on one line, but it bugged me and i wanted my template to spit out nice neat code.

anyways, will have the template up soon for all to download and use...

Labels: , , ,

Friday, October 30, 2009

WAMP password reminder

when phpmyadmin displays this error:

Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password

to change user password in wamp:

1. open phpmyadmin

2. click on privileges

3. click 'edit previelges' (little icon at the end) for user 'root'

4. scroll down to 'change password'. chuck in your password and hit 'Go'

5. repeat steps 3 and 4 for user 'localhost'

6. open your config.inc.php file from your wamp install directory. mine is c:/wamp/apps/phpmyadmin3.2.0.1/

7. find this line $cfg['Servers'][$i]['password'] and chuck your password here.

8. restart wamp and browsers ;]

Labels: , , ,