World Wide Web Technology

Firefox redirecting localhost to www.localhost.com

To avoid this annoying behavior of Firefox that redirects http://localhost to http://www.localhost.com when you are developing on the localhost, try one or more of the following tips: Use other browsers such as IE or Chrome. Use “127.0.0.1” instead of “localhost”. Make sure http://localhost is correctly configured and responding. Make sure C:\Windows\System32\drivers\etc\hosts has and only has …

Firefox redirecting localhost to www.localhost.com Read More »

Make Firefox to Not Send HTTP Referer (or On a Per-Site Basis)

By default browsers such as Firefox sends the Referer information to the target URL in the HTTP header, as defined by HTTP protocol, so the destination URL / website knows where you have come from. For instance, when you click this link to one of my friends’ sites, it would know you have arrived at …

Make Firefox to Not Send HTTP Referer (or On a Per-Site Basis) Read More »

HTML: Make a Page Refresh Every xx Seconds

A quick tip for those who just started learning HTML. It’s possible to add a line of code in your HTML page so that it’s automatically refreshed every few seconds when loaded in the user’s browser. To make the page automatically refresh itself every 60 seconds, just insert the following code in the <head></head> section …

HTML: Make a Page Refresh Every xx Seconds Read More »

The Ultimate Way to Cloak and Hide any Website Address or URL (Stealth Forwarding)

Most of the existing URL cloaking services are only a redirection by a randomly generated short URL. The real URL of the target website or web page will eventually be revealed when the visitor arrives at it after the obscure redirection. So how to ACTUALLY hide and cloak the destination URL of any website or …

The Ultimate Way to Cloak and Hide any Website Address or URL (Stealth Forwarding) Read More »

CSS: How to write CSS rules to detect or target Chrome, Safari or Opera browsers only?

It’s easy to target firefox, just write as expected by the standards, at least most of the time. It’s also easy to target IE and any specific versions of them by a few of the famous hacks or the IE conditional comments to selectively include style sheets by version numbers. But how does one write …

CSS: How to write CSS rules to detect or target Chrome, Safari or Opera browsers only? Read More »

Use Relative Protocol URL Address to Automatically Determine Web Address Protocol (HTTP or HTTPS)

Here’s a really interesting bit about how you can omit the protocol part of a web address in your web pages. The predominant belief is that an HTTP:// or an HTTPS:// has got to be prefixed to a URL or it won’t work, truth is, it will. Try the following link: Click Me! View the …

Use Relative Protocol URL Address to Automatically Determine Web Address Protocol (HTTP or HTTPS) Read More »

HTML: Make Content Editable in Element / Tags without JavaScript

It’s not well known but this feature was invented by Microsoft and has been implemented across all major modern browsers ever since IE 5.5. Adding an attribute of contenteditable and assign a value of “true” to it makes the content value / inner text of that element editable by a single click: <blockquote contenteditable="true">Click to …

HTML: Make Content Editable in Element / Tags without JavaScript Read More »

PHP: How to distinguish values in $_POST or $_GET that are sent via HTTP requests and those that are set / assigned in the code

To send parameters to a PHP script, you can either fabricate a form and post a few variables by the POST method or simply send a request of a URL full of GET value pairs. This way, in the server side PHP script code, you can retrieve these parameters sent from the client in $_POST …

PHP: How to distinguish values in $_POST or $_GET that are sent via HTTP requests and those that are set / assigned in the code Read More »

PHP: How to detect / get the real client IP address of website visitors?

It may seem simple at first because most of us should be relying on the server side environmental variable REMOTE_ADDR solely for client IP addresses: echo $_SERVER[‘REMOTE_ADDR’]; Yet it’s barely enough to get the real IP for a variety of circumstances such as when the user is visiting your website from a proxy server. To …

PHP: How to detect / get the real client IP address of website visitors? Read More »

2 reasons you should host all static content on a different domain

That is, to host all static content such as ready-made images, scripts, style sheets on a different domain rather than the primary one that hosts the page of the current URL. For example, if you intend to add static images to the web page located at http://www.example.com/page.html, you should not place the images on www.example.com, …

2 reasons you should host all static content on a different domain Read More »

You can actually use percentage values for padding and margin

Which seems quite new to me as I have never used any percentage values on them before. Took some tests and I found out that all major modern browsers supported percentage values for padding and margin very well, even IE6. This should come very handy in positioning things up according to the parent width. See …

You can actually use percentage values for padding and margin Read More »

scp, rsync: Transfer Files between Remote Servers via SSH

Chances are you have a bunch of different hosts that are housing your website files, for the sake of data safety (never put all eggs in a single basket) and possibly some SEO advantage. If that is the case, you will infrequently come to the need to move some files from one host server to …

scp, rsync: Transfer Files between Remote Servers via SSH Read More »

How to prevent or stop my website and pages from being indexed by search engines?

It’s really weird that one would like to do this but perhaps you are running some private website dedicated to just an intimate group. Anyway, you can stop search engines indexing your web pages by putting a meta tag in the header section of them: <meta name="robots" content="noindex" /> That’s it. Any search engines abiding …

How to prevent or stop my website and pages from being indexed by search engines? Read More »

How to redirect the visitor to another page or website?

This is one of the most common tasks in website development and also one of the most frequently asked question according to some of the keyword research tools. Well, you have 3 ways to achieve a web page redirection. Use PHP header() function to modify and send a HTTP Location header: header("Location: /thankyou.html"); // redirect …

How to redirect the visitor to another page or website? 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 »

Scroll to Top