Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Archive for November, 2014

Date and time calculations in PHP

Sunday, November 30th, 2014 by Servage
TimeCalculations with date and time are essential to most web applications. It is both the ability to create and display a proper date, as well as being able to add or subtract intervals of time from it. For example being able to show the time an hour from now, or showing the date in 7 days. These are basic operations supported by PHP via the DateTime class. It offers an interface to create, manipulate and display DateTime objects in whatever scenario you might have. There are many different ways of handling dates and times in PHP. Previously it was often recommended to work with Unix timestamps and add/subtract seconds from such timestamps, to ...

CSS browser compatibility and reset

Thursday, November 27th, 2014 by Servage
Css-ResetCascading Style Sheets are the design basis for any modern website. They efficiently direct the visual display of the HTML in the browser. Nowadays it is common understanding that HTML contains content only, while all design resides in other resources, such as css or image files. With CSS you effectively program your design with an expectation of it working in all browsers. Different interpretation Even though CSS is standardized like HTML, the different browsers interpret instructions slightly different - just like they support or understand HTML tags slightly different. This is an unfortunate side effect of browser developers being at different stages in the implementation of new standards (and in some cases even ...

Understanding the basics of AJAX

Wednesday, November 26th, 2014 by Servage
images The term AJAX means "Asynchronous JavaScript and XML". It describes a standardized process of exchanging data between a client's browser and the server's back-end asynchronously in relation to the page load. Originally this was intended to be XML data, but today this could essentially be any data format. Hence AJAX mainly references the "asynchronous" and "JavaScript" parts of the abbreviation when talking about it today. Browser compatibility AJAX processes are supported by all major browsers today and has effectively become a common way of working with interactions between JavaScript and back-end systems. It is implemented via the XMLHttpRequest object in the browsers' JavaScript interpreters but often used indirectly via wrappers. This post will be using AJAX via the popular jQuery framework, ...

Drop-shipping is a potential with challenges for modern e-commerce

Monday, November 24th, 2014 by Servage
Drop-ShippingThe method of drop-shipping has existed for decades and has grown to massive proportions with the rise of numerous online stores. It is actually quite simple in theory: You are the seller of goods and focus purely on marketing, sales and customer service. Whenever you receive an order, you get your drop-shipping supplier to send the product straight from his warehouse right to the customer. You never touch the product. You just sell it. What are the benefits of drop-shipping No need to maintain inventory, which reduces the investment requirement to startup and fund an online store. Outsourced packaging, shipping and returns since this is done by the service provider which gives you time to focus on ...

Debugging JavaScript errors

Saturday, November 22nd, 2014 by Servage
Debug-JavascriptWorking with JavaScript can be a major challenge sometimes. First of all, you usually work in a browser where you need to refresh the page to reload a changed script. This imposes significant challenges to testing workflows where you actually move deep into a flow of events before you get to the point you are actually testing. Secondly, JavaScript handles error logging and output differently from what you are used to from PHP. JavaScript notifies you about problems by adding information to the console while the execution silently terminates. JavaScript console The console is a tool in the browser where you can see output from scripts and issue new commands. It is actually a ...

Prevent session fixation and hijacking

Friday, November 21st, 2014 by Servage
phpsec_0403Session fixation is similar to session hijacking. The fixation method means the attacker obtains a valid session ID from the application whereafter the attacker gets the victim to use the same session ID. The hijacking method means the attacker gets to know the identifier for an existing user session. Either way the session will thereafter be known to the attacker who can present himself as the user to the application. This is dangerous because if an attacker can make the application believe to be the user, the attacker can essentially do whatever the user would be able to do. It is like having forgotten to logout whereafter someone takes over the computer and continues as that previously logged-in user. Understanding ...

Input-types in HTML forms

Wednesday, November 19th, 2014 by Servage
download (3)HTML forms are very versatile and allow you to submit a wide range of different types of input, ranging from text boxes and text areas to checkboxes, radio buttons, and more. Understanding the pros and cons of the different input-types enable you to create appealing and efficient forms that users like and use. It increases usability and conversion. Text boxes The regular text box is probably the type of input you will use most often. It accepts a wide range of alphanumeric text and other characters in a single-line box. The general format of a text box input is: <input type="text" name="my_field" value="default_value" /> The above example declares an "input" tag with "type", "name" and "value" ...

JavaScript data types explained

Tuesday, November 18th, 2014 by Servage
javascript-codeAll programming languages have variables that can contain some values. The purpose of variables is to store information for long or short periods of time during a program's execution so it can use the information in further calculations or for display. In JavaScript you should declare a variable like below: var name = "John"; The snippet declares a variable called "name" with the value "John". However, it actually forgets to state the obvious: What kind of variable is "name"? This is where data types come into the picture. The data type of a given variable tells JavaScript which kind of information to expect - and enables JavaScript to allow or prevent certain types of action with ...

Design your content as a product

Sunday, November 16th, 2014 by Servage
Designing Content FirstWe are not always focusing much on content and giving it enough attention during our web design process. If we would treat content like one of our products, our approach might change and we would think of the content's design, packaging, and marketing aspects in more detail. Therefore this post aims to focus your attention on content-production so you get more value from it. The general problem is the way that web design is usually structured. The entire process is actually not very content-friendly. The normal procedure is often that initially a business stakeholder identifies the need for a new or refreshed website. The next step is a web designer or consultant starting to lay out ...

Split-testing answers your unsolved questions

Saturday, November 15th, 2014 by Servage
Split_testingSplit-testing is the method of placing different ideas for the same components on a web page, to test and thereby know which one will work the best to increase conversion. Therefore, if you know your weaker links and know how to overcome them the best way using A/B testings, you definitely will have a greater chance at winning the battle of conversion optimization at first hand. Conversion optimization is a vast subject to cover in a single post as numerous books are devoted to this subject alone. Therefore this post will focus on the split-test or A/B testing of landing pages and its role in conversion itself. We have very complex websites today in terms ...