Styles

Sunday, March 21, 2010

Opacity in IE, Firefox and Chrome

pngs and other images require separate styling attributes for IE and Firefox. Below are the two attributes that will allow transparency to be supported for both browsers:

.menu .hover .menuitems
{
 filter: progid:dximagetransform.microsoft.alpha(opacity=80);
 opacity: 0.8;
}

Note: the "filter" attribute is used for IE, and the "opacity" attribute is used for FF.

It must also be noted that this will actually make the entire image transparent so all text found within it will most likely not have the desired effect.

This is different from images that have transparency in it.

Thursday, March 4, 2010

Apache Configuration

XAMPP Server Configuration

When installing xampp, generally you wouldn't want to keep all your PHP applications nested within the installed folders incase you choose to uninstall it for a newer version. The following file will need to be configured to place php applications in your own project folder (e.g. D:\Projects\Php\)

C:\Program Files\xampp\apache\conf\httpd.con

DocumentRoot "D:/Projects/Php"
<Directory "D:/Projects/Php">
     Options Indexes FollowSymLinks Includes ExecCGI
     AllowOverride All
     Order allow,deny
     Allow from all
 </Directory>

DocumentRoot for phpMyAdmin

When changing the DocumentRoot as shown above, this will change the location of the mySQL admin console. Therefore a shortcut for "phpMyAdmin" must be created on D:/Projects/Php from C:\Program Files\xampp\phpMyAdmin. This will allow for access to mySQL via http://localhost/phpMyAdmin

Default Documents

If you don't want to specify the .php extension in the URL by having a default php load within any folder on your site, you can add any specific php file names to the following file:

C:\Program Files\xampp\apache\conf\httpd.conf

DirectoryIndex index.php

XAMPP mySQL databases location

Databases can generally be copied and pasted from the following location:

C:\xampp\mysql\data

Database Corruption

Sometimes the database can get corrupt from copying files from the \data\ directory. This will need a reboot of the xampp server. Once this happens there will be an error message on the site saying that "[table_name] has crashed or is corrupt and will need a repair". If that is the case you must run the following on the mySQL database:

REPAIR TABLE [table_name]

Default "root" User for mySQL databases

The default password for root is blank, however changing this can be done from the xampp control panel by click the "Shell" button and typing the following command

mysqladmin -u root -p password NEWPASSWORD

Where NEWPASSWORD is the password you want to specify

Default "root" password for phpMyAdmin


The following lines need to be updated in the file: C:\xampp\phpMyAdmin\config.inc.php

$cfg['Servers'][$i]['user']                 = 'root';
$cfg['Servers'][$i]['password']             = 'NEWPASSWORD';