2009

PHP, JavaScript: Stop and prevent others from framing your site or web page

Though it does increase traffic and the pageviews, it doesn’t feel quite good with someone who’s loading your website or page as a part of theirs in the form of a <frame> or <iframe>, leeching your content as part of theirs. To prevent them from loading your pages this way, and make the visitor browser …

PHP, JavaScript: Stop and prevent others from framing your site or web page Read More »

CSS: How to align HTML input checkbox and radio with text on the same line?

The common HTML form input controls of checkbox (<input type=”checkbox“>) and radio (<input type=”radio“>) can be tricky to be aligned correctly in the same line with the text or image across all modern browsers. Without any CSS styling, they usually place themselves 3 or more pixels above or below the normal text flow which look …

CSS: How to align HTML input checkbox and radio with text on the same line? Read More »

Please, by all means, don’t use overflow:hidden for content!

No matter how fairy or pretty your design / template is, never use overflow:hidden for content containers. Content comes a thousand times more important than any design or layout. I don’t care how much you hold proud your artistic work and how you think accommodating the content in any way possible would ruin the holy …

Please, by all means, don’t use overflow:hidden for content! Read More »

CSS: Set width on inline elements with inline-block

With display:block elements we can freely set the hard width of them. However for inline elements, width:200px simply won’t work at all. One approach is to float the element which usually causes other problems and isn’t handy at all. So how to set width to inline elements without floating them in CSS? The answer is …

CSS: Set width on inline elements with inline-block Read More »

CSS: Curved or Rounded Corner Boxes and Images Using border-radius

In CSS3, border-radius is the rule you would use to achieve curved corner borderlines, but for now, IE and Opera doesn’t support this trick. With a little script help in the form of a .htc, you can make a cross browser compatible rounded corner box such as a <div> or an <img>. -moz-border-radius: 9px; -webkit-border-radius: …

CSS: Curved or Rounded Corner Boxes and Images Using border-radius Read More »

Linux: How to find all the files containing a particular text string?

At Linux command line, to find a particular text string in all the files from the current directory recursively (that is, including all those files from the child or grandchild directories), use something like this via SSH: find . -exec grep -l "needle" {} \; This command searches through all directories from the current directory …

Linux: How to find all the files containing a particular text string? Read More »

How to make IE6 to style HTML 5 tags?

HTML 5 comes with a bunch of new tags that IE6 cries that it doesn’t know them, thus refusing to style them according to the CSS. To baby-sit this stupid browser one last time, adding these JavaScript lines in the <head> of your web page that utilizes HTML 5 tags: <script> document.createElement(‘header’); document.createElement(‘nav’); document.createElement(‘section’); document.createElement(‘article’); …

How to make IE6 to style HTML 5 tags? Read More »

PHP: Session ID changes automatically at every request / page load

Ideally the initial session id will remain the same throughout a session unless the developer has explicitly asked PHP to change it by the session_regenerate_id() function or the session_id() function. However, there’s a slight chance that you may encounter this problem of automatic changing session ID upon every new request when you are developing things …

PHP: Session ID changes automatically at every request / page load Read More »

CSS: Rotate Text / Image Elements by 90, 180 or 270 Degrees

As a quick digest of this article by Jonathan. You can literally rotate any HTML element by a certain degree with CSS, be it text or image or something else. After testing across a few modern browsers, the only one that’s not supporting this rotation technique is Opera. The CSS rules you need for a …

CSS: Rotate Text / Image Elements by 90, 180 or 270 Degrees Read More »

How to change the browser window status bar text of Firefox with JavaScript?

It’s strange that you can accomplish this in IE while you can’t make it happen in Firefox. Well, that’s because the development team has decided that it’s potentially annoying and harmful for web developers to change the text of Firefox status bar whatever way they want. So the simple answer is, you can’t. But there’s …

How to change the browser window status bar text of Firefox with JavaScript? Read More »

Key Differences between the Web Design of Google, Microsoft and Yahoo

Microsoft and Yahoo is colorful in colors but Google is colorful in the imagination. Google uses much less colors than Microsoft and Yahoo do. Yet somehow, Google comes out as the versatile one. Google uses much more traditional colors than Microsoft and Yahoo do and rarely change in the style, yet it comes out as …

Key Differences between the Web Design of Google, Microsoft and Yahoo Read More »

One Simple Way to Encrypt, Obfuscate, Hide or Protect Your PHP Code

This way is so simple that anyone who’s a beginner in PHP can use it immediately to obfuscate and hide the original PHP code. Generally, it’d make it much harder for someone to find a specific phrase in your code as it’s encrypted, though in a rather simple way using 4 PHP functions: gzinflate(), gzdeflate(), …

One Simple Way to Encrypt, Obfuscate, Hide or Protect Your PHP Code Read More »

Linux wget Command to Download and Mirror a Website in Static Local Copy

wget is such a wonderful command in Linux you can ever get. Consider blessed to have it in your SSH arsenal. Now, not only does it allow you to download something neatly from the command line to the current working directory — that’s why WordPress always puts the latest version of the blog script at …

Linux wget Command to Download and Mirror a Website in Static Local Copy Read More »

Scroll to Top