Never ever use short variables like $a or $temp or other lazy short names.
Use variable names that are understandable and describe what it contains.
And using a camelNotation makes it easy to read.
Never start with underscore or other kind of separator for names.
$strReturn = ‘Nice code’;
Only use underscore for constants where you can not use tha camel notation.
After writing this to my console I enter the password for my server and its done!
This is the fastest way of updating my site from my local disk.
The good thing about this that I use -u so it does not upload the files that have not been changed on my local disk. You can also drop the -v and make an Automator app but then you have to make the public key for your ssh connection so you don’t have to enter the password each time you running the app.
Ok here is a list. Now we must make the list items to be horizontal and not vertical. So we must use CSS to set the float to be left and make the list-style: none;
.menu li{float: left; list-style: none; }
Then we must make them look like a buttons. So we add some borders and padding and margins. Then the whole CSS code look like this:
When you post a form with checkbox it dose not return any value when the checkbox is not ticked.
This is something that should have been fixed a long time ago.
But for now here is the solution:
You put an hidden input before checkbox input with the same name.
Since the last checkbox overwrite the value when it is checked, the hidden input do not return “0″ but when the checkbox is not checked, the hidden input with the same name returns a “0″.
So when the checkbox is checked it returns “on” and when it is not checked it returns “0″
And to make it easier to click on the ckeckbox use “label” tag around the name.
Before:
My Checkbox
After:
This way you can click on the checkbox label and make it checked.
The correct way to write an checkbox checked from the start is like this:
This example shows how you can show semi-transparent png images in IE and don’t mess up the code in other browsers. It uses only CSS and no JavaScript.I use the attribute style to make a style for other browsers then IE. And I’m using the filter style that works only for IE in the normal section.But first you have to make a semi transparent png image.
Then make an div layer and set a class name “mydiv”
And here is the CSS code:
.mydiv{
background-repeat: repeat;
position: relative;
display: block;
width:250px;
height:200px;
text-align: center;
/* Mozilla Firefox and other non IE based browsers ignores the filter style*/
/* IE ignores this part IE can not read styles with [attribute]*/
.mydiv[class]{
background-image: url(back_g.png);
}
body{
background-image: url(BG.png);
background-repeat: repeat;
}
Since IE can not show semi-transparent png images, we have to use the filter style that only works in ie. But if we use this code we have to make sure that other browsers can show the png file as well. So we use the styles with attributes. And since IE can not read this part, we can put everything that IE dose not need to read there.