Webmaster Spice

Web Design , Graphic Design , Web hosting & SEO Tips

1 million domain names registered in 2010

Comments Off

verisign

The Verisign company, which specializes in network infrastructure and in particular management areas. Com and. Net, announced, in a statement, a 6% growth a year on record names top level domains (TLDs) . So, these last 12 months, 11 million of new deposits have been recorded to cross the bar 193 million.

The domain names in. Com and. Net remain well ahead and posted an increase of 2.7% over the last quarter of 2009 and 7% in one year. There are a total of 99.3 million. Com and. Net in the world. Since January, 8.1 million domains. Com and. Net have been filed, with an average of 2.7 million per month. Among them, 72% were renewed, a rate slightly higher compared to the same period last year (71.2%).

Regarding regional extensions (ccTLD), Germany (. Of) still holds the pole position ahead of China (. Cn), the United Kingdom (. Uk), the Netherlands (. Nl) and the European Union (. eu). According AFNIC, there would now 1,756,118 domains. En cons 1.5 million registered in September 2009.

404, 301 redirect: headers and common HTTP response codes

Comments Off

When connecting to a Web page, the client (browser) sends a request to which the server processes the response, following the HTTP protocol handling code returns a 3 digit number.
This code is located on the first line of response, and is of the form:

HTTP /1.1 200 OK

. In php, the php function header () function from your script to adapt the code that the server returns to “force” the behavior of the client browser.
Quick overview of the most common codes.

200 OK

The code 200 is Nirvana. Everything went well, nothing to report. This is the default code.

301 Moved Permanently (aka Permanent Redirect)

The 301 or “permanent redirect” is widely used in SEO. He pointed to the client (browser or search engine crawler) that the requested resource (document, image, etc.) has been permanently moved.
Suppose I rename a file. As it is, search engines send users to pages that no longer exist (they will be an error 404 – document not found), and any inbound links enjoyed my pages are lost they also point vacuum.
With a permanent redirect, the motors being warned that the document has been moved, will update their indexes to send visitors directly to the correct URL. At the same time, the popularity brought by inbound links will be transferred to the new pages.

302 Moved Temporarily

Near the 301 redirect, the code 302 indicates that a document has been moved temporarily. Engines so as browsers will download the document at its new address, but the references will henceforth be the usual URL.

304 Not Modified

When they have a document in the cache, the browser sends a header If-Modified-Since that includes the date on which they have downloaded the document for the last time. If the document has not been changed, the server sends a response code 304, “unmodified”, that prevents the browser to re-download content that is current in its cache.

404 Not Found

The document to which the user tries to access has been moved, deleted, or the provided URL is simply incorrect. The server has nothing to return. You can configure Apache, at the Virtual Host (or. Htaccess) so that it refers, in this case, a particular document through the ErrorDocument 404 / file.html. If 404 is file.html will be served. This can (and should always) be used to send a custom 404 page, which includes at least a mini-site map, so that the user can continue his visit on the site.

500 Internal Server Error

The code 500 is the end of the world. The server failed to respond to the request, often due to a configuration error. So, first check your. Htaccess, just a trailing semicolon for the server so it does more.

Function header

The header () function in PHP to send a response code other than the usual 200. Because it modifies the headers, it must be used BEFORE a printable character is sent to the client. Otherwise, a warning “headers already sent” will be generated. Here, for example, the complete syntax for using the header () function to send a proper 301 redirect:

header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: http://www.nouvelle-url.com/”);
exit;

Procedures and functions in MySQL: Basics

Comments Off

Oracle has a language called PL / SQL to compile procedures and functions on the server. These procedures and functions can be called directly in SQL. When they are written correctly, they usually allow a significant performance gain, in addition to being useful and enjoyable to use. Basically, the procedures and functions are an excellent way to provide additional layer of intelligence to your database server, allowing it to perform complex tasks without recourse to external scripts. It therefore saves the communication protocol between database and application. Well … It is also possible in MySQL!

Mini Reminder: Procedure or function?

If you’re torn between creating a stored procedure or function, remember that the only difference between the two is a function fetches a result (even going through tons of intermediate steps), while a procedure is to action. Basically, if you want to have a return value, you need a function. Otherwise, choose a procedure.

In which case use, and how?

You can turn to ProcStock (for “stored procedures”, the term is also often used for functions) wherever you run heavy computations treatments and / or large volumes of data. The huge advantage is that you will not have to repatriate large resultsets to treat them as PHP (for example), then put them in base: everything is done directly in one simple application, which will call the function / procedure.
The MySQL functions that you define are used exactly like built-in functions (although they are usually written in C and compiled with the server … it’s also feasible to gain maximum performance in MySQL, but this is a another story), such as AVG (which calculates an average over the values of a field). Without AVG (syntax: SELECT AVG (field) FROM table), it should retrieve relevant results, add them and divide them by their number: (1 +5 +6) / 3 = 4. AVG did it alone and refers directly 4. Obviously, it is not very serious to have to get 3 lines. But with 20,000 records, it’s different, and performance will be affected, particularly due to the use of RAM required to run the script.
It can also be very interesting to use procedures and functions on the server database when multiple applications frontend in different languages may have to perform the same: rather than writing (and maintaining …) common shares several languages, deport them all running on the SQL server and ask customers to only interact with stored functions.

Conclusion

Lean on your PHP applications, there are certainly lots of things you can veer to stored procedures. The performance gains should be quickly felt, for a minimal learning effort.
In a future post, we will go further with stored procedures, including using parameters, cursors, handlers and whatnot. The challenge is to find an interesting example