for separation purposes when it's really necessary. You do not have to encase the whole page in a main div like the example. That will be up to you.
Here, you can find some answers to questions that have vexed us. Some may be obvious, others may solve a problem.
Getting a menu that looks right with a design and being able to tweak it in real time has proven to be very useful. The menu generator povides this ability and the resulting css can be copied and pasted onto a site. The table at the bottom of the code which is commented out. can be dropped back into the menu generator to give ready access to the existing settings.
Pingdom tools As the site says: Nobody Likes a Slow Website
Full Page Test tool to help you analyze the load speed of your websites and learn how to make them faster. It lets you identify what about a web page is fast, slow, too big, what best practices you're not following, and so on.
Each time I set up Wamp server, I have to refresh my memory about some of the tricks to get it set up properly. Here are some extra steps that I take to get it to work the way I want. If I keep this up to date, it will be much more simple in the future.
The simple bit: download and run an nice new version of wampserver.
I need to run wamp on port 8080 instead of its default port 80. This is to prevent conflict with windows iis. It seems easier to change wampserver. To achieve this:
Next I need to enable large files to be imported into phpmyadmin. To do this:
open C:\wamp\Apache2\bin/php.ini.
change post_max_size = 8M to post_max_size = 128M
change upload_max_filesize = 2M to upload_max_filesize = 128M
Next I want to have access to apache and MySQL on start up Using Windows 7. So, select Control Panel -> Administrative Tools -> Services and change the settings for wampapache and wampmysqld from Manual to Automatic.
To set up mail - edit MAIL SETTINGS IN php.ini
open C:\wamp\Apache2\bin/php.ini and set:
smtp_server = mail.example.com (your outgoing mail server)
smtp_port = 25 (Your outgoing mail server port number)
The next two lines may not be in the file, create them with the SMTP Credentials
auth_username = example_username@example.com
auth_password = example_password
Here are some useful commands
I have spent the past two days working to overcome issues with browser compatability. Specifically for IE6 and before. While I endorse the concept of making the web experience great for all, I have begun to understand that the continued support for IE6 browsers is counter productive. There are several free alternatives to IE6 which comply with W3C standards. Good examples are Firefox and Safari. To continue to spend time making pages render the same in all browsers merely encourages users of IE6 to continue using that product.
For environmental reasons we have successfully made the break from CFC refrigerant and now use unleaded petrol as if the leaded version had never existed. We have even learned to wear seat belts and refrain from driving when drunk. Surely, the conversion to a standards complient browser is not too much to ask of our visitors.
I have set up a linux server for home use and uncovered many secrets in the last few days.
This may deserve its own page
Here are some of them:
After much command line work, I installed the GUI 'sudo apt-get install kubuntu-desktop'. That helped but root permissions doesn't seem to be available for file management. To get around this open konsole and type 'sudo gksudo dolphin'.
The installation kindly loaded the LAMP stack for me but it was a further step to install phpmyadmin. 'sudo apt-get install phpmyadmin'.
That gave me all that was required for running web site. However, not having write access to the /var/www directory was an issue. Resolved by creating a symbolic link in var/www to my home directory. 'sudo ln -s /home/pathToSiteName/ /var/www/SiteName'
Next issue was ftp access. 'sudo apt-get install vsftpd'. Then edit the /etc/vsftpd.conf file to provide the required access. I missed removing the comment from write-enable=YES which caused some significant delay in getting things to work.
Now ftp points at my /home/me/public directory and the symbolic link in /var/www redirects to the required folder. Neat!
To get firefox to open with a larger window use 'startx -e firefox -height 800 -width 1200. It is useful to have a browser available for copying from how to guides into the konsole window.
After searching for a snipet of code to select anniversary dates, I came across Stackoverflow. Unfortunately, their response did not overflow between years. A bit of lateral thinking and here is the solution that I came up with. Posted to Stackoverflow in case it is useful.
What we want to achieve is a list of anniversaries ocurring in a recent date range. To achieve this we need to generate a list of all anniversaries that cover the date range. The solution that I have used, generates anniversary records for last year, this year and next year and outputs only those records that fall within the given date range. The union query looks like this:
SELECT Date_Add(Date,INTERVAL (Year(now())-Year(Date)-1) YEAR) as dt, Detail
FROM diary
WHERE Date_Add(Date,INTERVAL (Year(now())-Year(Date)-1) YEAR)
BETWEEN Date_sub(now(), INTERVAL 7 Day) AND Date_add(now(), INTERVAL 21 Day)
UNION
SELECT Date_Add(Date,INTERVAL (Year(now())-Year(Date)) YEAR) as dt, Detail
FROM diary
WHERE Date_Add(Date,INTERVAL (Year(now())-Year(Date)) YEAR)
BETWEEN Date_sub(now(), INTERVAL 7 Day) AND Date_add(now(), INTERVAL 21 Day)
UNION
SELECT Date_Add(Date,INTERVAL (Year(now())-Year(Date)+1) YEAR) as dt, Detail
FROM diary
WHERE Date_Add(Date,INTERVAL (Year(now())-Year(Date)+1) YEAR)
BETWEEN Date_sub(now(), INTERVAL 7 Day) AND Date_add(now(), INTERVAL 21 Day)
ORDER BY dt
There you have it. This will reliably select anniversaries in the given period. If a longer period is required, it may be necessary to generate additional SELECT statements and join them with UNION.
The server name for connection on my development machine is localhost and something completely different on my hosted site. It is a relatively simple matter to set up the same usrename and password for both environments but not the server. Consequently, when I upload a site to the server, it fails to make a connection to the database unless I remember to change it both immediately before the transfer and then back again so that it continues to work on the development machine.
The solution that I now use is to have a file on my local server that contains the local server settings. if this file is present I include it and use its settings. If it is not present, it sets the remote server settings.
if(file_exists('local_server.php')){ include_once('local_server.php'); }else{ $server = 'WhateverYourServerNameIs'; } $this->set_conn(mysql_connect($server, $username, $password)) or $message='unable to create a connection'; ...
I have just spent some hours pondering over the horizontal menu overflowing it's div. When will I learn to use the web to solve issues first. My first attempt at a search 'Content overflow div' led me to "http://www.w3schools.com/Css/pr_pos_overflow.asp" (which no longer exists). It works, brilliant!
I strongly suggest you use XHTML 1.0 Strict and conform to it. For IE's sake, you need to have the doctype on the first line of the html file. Where X = < and Z = >
X!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"Z Xhtml xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"Z XheadZ XtitleZXHTML 1.0 StrictXtitleZ Xmeta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /Z Xmeta http-equiv="Content-Style-Type" content="text/css"/Z Xmeta http-equiv="Content-Script-Type" content="text/javascript"/Z Xlink rel="stylesheet" type="text/css" href="main.css"/Z Xlink rel="stylesheet" type="text/css" media="print" href="print.css"/Z Xscript type="text/javascript" src="file.js"ZX/scriptZ X/headZ XbodyZ Xdiv id="main"Z XdivZSome ContentX/divZ XdivZSome More ContentX/divZ X/divZ X/bodyZ X/htmlZ