Android (14)

When are source code releases made?

When they are ready. Some parts of Android are developed in the open, so that source code is always available. Other parts are developed first in a private tree, and that source code is released when the next platform version is ready.

In some releases, core platform APIs will be ready far enough in advance that we can push the source code out for an early look in advance of the device's release; however in others, this isn't possible. In all cases, we release the platform source when we feel the version has stabilized enough, and when the development process permits. Releasing the source code is a fairly complex process.


Do all Activities run in the main thread of an application process?

By default, all of the application code in a single process runs in the main UI thread. This is the same thread that also handles UI events. The only exception is the code that handles IPC calls coming in from other processes. The system maintains a separate pool of transaction threads in each process to dispatch all incoming IPC calls. The developer should create separate threads for any long-running code, to avoid blocking the main UI thread.


How is the Android software developed?

Each platform version of Android (such as 1.5, 1.6, and so on) has a corresponding branch in the open-source tree. At any given moment, the most recent such branch will be considered the "current stable" branch version. This current stable branch is the one that manufacturers port to their devices. This branch is kept suitable for release at all times.

Simultaneously, there is also a "current experimental" branch, which is where speculative contributions, such as large next-generation features, are developed. Bug fixes and other contributions can be included in the current stable branch from the experimental branch as appropriate.


What kinds of devices can be Android compatible?

The Android software can be ported to a lot of different kinds of devices, including some on which third-party apps won't run properly. The Android Compatibility Definition Document (CDD) spells out the specific device configurations that will be considered compatible.

For example, though the Android source code could be ported to run on a phone that doesn't have a camera, the CDD requires that in order to be compatible, all phones must have a camera. This allows developers to rely on a consistent set of capabilities when writing their apps.

The CDD will evolve over time to reflect market realities. For instance, the 1.6 CDD only allows cell phones, but the 2.1 CDD allows devices to omit telephony hardware, allowing for non-phone devices such as tablet-style music players to be compatible. As we make these changes, we will also augment Google Play to allow developers to retain control over where their apps are available. To continue the telephony example, an app that manages SMS text messages would not be useful on a media player, so Google Play allows the developer to restrict that app exclusively to phone devices.


Why is Google in charge of Android?

Launching a software platform is complex. Openness is vital to the long-term success of a platform, since openness is required to attract investment from developers and ensure a level playing field. However, the platform itself must also be a compelling product to end users.

That's why Google has committed the professional engineering resources necessary to ensure that Android is a fully competitive software platform. Google treats the Android project as a full-scale product development operation, and strikes the business deals necessary to make sure that great devices running Android actually make it to market.

By making sure that Android is a success with end users, we help ensure the vitality of Android as a platform, and as an open-source project. After all, who wants the source code to an unsuccessful product?

Google's goal is to ensure a successful ecosystem around Android, but no one is required to participate, of course. We opened the Android source code so anyone can modify and distribute the software to meet their own needs.


What is the Android Open Source Project?

The people oversee the project and develop the actual source code. The processes refer to the tools and procedures we use to manage the development of the software. The net result is the source code that you can use to build cell phone and other devices.


What kind of open-source project is Android?

Google oversees the development of the core Android open-source platform, and works to create robust developer and user communities. For the most part the Android source code is licensed under the permissive Apache Software License 2.0, rather than a "copyleft" license. The main reason for this is because our most important goal is widespread adoption of the software, and we believe that the ASL2.0 license best achieves that goal.


What does “compatibility” mean?

We define an "Android compatible" device as one that can run any application written by third-party developers using the Android SDK and NDK. We use this as a filter to separate devices that can participate in the Android app ecosystem, and those that cannot. Devices that are properly compatible can seek approval to use the Android trademark. Devices that are not compatible are merely derived from the Android source code and may not use the Android trademark.

In other words, compatibility is a prerequisite to participate in the Android apps ecosystem. Anyone is welcome to use the Android source code, but if the device isn't compatible, it's not considered part of the Android ecosystem.


What is involved in releasing the source code for a new Android version?

Releasing the source code for a new version of the Android platform is a significant process. First, the software gets built into a system image for a device, and put through various forms of certification, including government regulatory certification for the regions the phones will be deployed. It also goes through operator testing. This is an important phase of the process, since it helps shake out a lot of software bugs.


Once the release is approved by the regulators and operators, the manufacturer begins mass producing devices, and we turn to releasing the source code.

Simultaneous to mass production the Google team kicks off several efforts to prepare the open source release. These efforts include final API changes and documentation (to reflect any changes that were made during qualification testing, for example), preparing an SDK for the new version, and launching the platform compatibility information.

Also included is a final legal sign-off to release the code into open source. Just as open source contributors are required to sign a Contributors License Agreement attesting to their IP ownership of their contribution, Google too must verify that it is clear to make contributions.

Starting at the time mass production begins, the software release process usually takes around a month, which often roughly places source code releases around the same time that the devices reach users.


CakePHP (18)

Why cakephp have two vendor folder?

There is two vendor folder, one folder in root and another is in “app” folder


If you have to validate a registration module for a user, what all can be possible ways , which one is the best?

Can be done on submission in controller, or using javascript/ajax while user is still filling the data. second option is better.


What is the naming convention in cakephp?

Table names are plural and lowercased,model names are singular and CamelCased: ModelName, model filenames are singular and underscored: model_name.php, controller names are plural and CamelCased with *Controller* appended: ControllerNamesController, controller filenames are plural and underscored with *controller* appended: controller_names_controller.php.


What are commonly used components of cakephp?

  1. Security
  2. Sessions
  3. Access control lists
  4. Emails
  5. Cookies
  6. Authentication
  7. Request handling


What is a component,helper and why are they used, is there other way we can do same thing, what is better.

A component is an independent piece of code written for specific task that can be used by calling in controllers (example : email component), helper is used for helping cakephp in rendering the data to be shown to user with views, these only adds to modularity in code otherwise same coding can be implemented in conrollers.


What is default function and default controller of cakephp which is called automatically?

Default controller is indexController.php and Default function is index.


What are are drawbacks of cakephp.

The learning curve, and it loads full application before it starts your task. Its not recommended for small projects because of its resource heavy structure.


What is MVC (model, view, and controller) in cakephp?

Model–view–controller (MVC) is an architectural pattern used in software engineering.
Model: Databases function exist in the model
View: Design parts written here
Controller: Business Login


How can you include a javascript menu throughout the site. Give steps.

By adding the javascript files in webroot and call them in default views if needed everywhere or just in the related veiws.


What is a Component in cakephp?

Components are packages of logic that are shared between controllers. They are useful when a common logic or code is required between different controllers.


Cpanel (87)

I just created a new account. Why does it show that disk space is already used?

  • When you terminate a user's account from the system, their UID may still own files. When you create new account, the system assigns it the next available UID, which is usually that of a terminated account. Thus the new account assumes ownership of all files that the old user owns, and gives the appearance that the user is already over quota though, even though nothing has been uploaded.
  • Tarballs ( .tgz .tar .tar.gz) may have files that the user who tarred them up on a separate system owns. When you untar files on your server, they are assigned ownership of whatever account has that UID.


How do I add images to my website?

You need to upload the image to your site and add an HTML img tag to your website's HTML code. You can perform this action with the HTML Editor in cPanel's File Manager interface (Home >> Files >> File Manager).


How can I back up my complete website to a drive on my computer?

To perform a complete backup of your website, use the Download or Generate a Full Website Backup feature in cPanel's Backups interface (Home >> Files >> Backups).


How can I change the stylesheet for cPanel in WHM?

You can edit a theme's stylesheet in WHM's Universal Theme Manager interface (Home >> Themes >> Universal Theme Manager). Complete the clone process on the desired theme, and then proceed with the desired changes to the theme's style sheets, images, etc.


How can I obtain information about how to develop software that integrates with WHM?

You can use our Plugins system along with the WHM API to perform any of the following actions:

  • To create a piece of software that interacts with WHM.
  • To add an icon for your software inside of cPanel & WHM.
  • To get information from cPanel & WHM
You can also create cPAddon scripts, which allow customers to download your software to their server. Domain owners can install the new software with cPanel's Site Software interface (Home >> Software/Services >> Site Siftware).


How do I change my cPanel username?

System administrators can change your cPanel username in WHM's Modify an Account interface (Home >> Account Functions >> Modify an Account).


How do I view my site as soon as I create it?

To view your website before DNS propagates, enter host.example.com/~username in your web browser, where host.example.com is your hostname.

After DNS propagates, you can navigate directly to your domain.

For more information about this feature, read our mod_userdir documentation.


Why will my server not resolve domains?

This is usually due to an invalid nameserver setting in the /etc/resolv.conf file.

  • Contact your datacenter for suggested nameservers within their network.
  • You can also add a valid public nameserver to /etc/resolv.conf.


What is an express transfer?

An express transfer transfers requested cPanel account(s) and performs the following actions on the source server:

  • Updates the account's A record to point to the destination server.
  • Changes the domain's nameserver entry to point to the destination server.
  • Updates the MX records to point to the destination server.
  • Adds a redirect for the Account Moved page (cgi-sys/movingpage.cgi) for the following file extensions:

    • .dynamiccontent
    • .pl
    • .plx
    • .perl
    • .cgi
    • .php
    • .php4
    • .php5
    • .php6
    • .php3
    • .shmtl
  • Blocks SSH and FTP logins to the source server for the transferred accounts.


How do I add a logo on the top of my website in the URL bar?

The logo in your browser's URL bar is called a Favorites Icon (favicon) These were initially used in the bookmarks for browsers and are also used in the URL bar.

For more information, search for a favicon tutorial on your preferred search engine.


CSS (73)

What are pseudo-elements?

Pseudo-elements are fictional elements that do not exist in HTML. They address the element's sub-part (non-existent in HTML) and not the element itself. In CSS1 there are two pseudo-elements: 'first-line pseudo-element' and 'first-letter pseudo-element'. They can be attached to block-level elements (e.g. paragraphs or headings) to allow typographical styling of their sub-parts. Pseudo-element is created by a colon followed by pseudo-element's name, e.g:


and can be combined with normal classes; e.g:


First-line pseudo-element allows sub-parting the element's first line and attaching specific style exclusively to this sub-part; e.g.:

P.initial:first-line {text-transform: uppercase}
<P class=initial>The first line of this paragraph will be displayed in uppercase letters</P>

First-letter pseudo-element allows sub-parting the element's first letter and attaching specific style exclusively to this sub-part; e.g.:

P.initial:first-letter { font-size: 200%; color: red}
<P class=initial>The first letter of this paragraph will be displayed in red and twice as large as the remaining letters</P>


What is ID selector?

ID selector is an individually identified (named) selector  to which a specific style is declared.  Using the ID attribute the declared style can then be associated with one and only one HTML element per document as to differentiate it from all other elements. ID selectors are created by a character # followed by the selector's name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit.

#abc123 {color: red; background: black}
<P ID=abc123>This and only this element can be identified as abc123</P>


What does !important mean in CSS?

Cascading Style Sheets cascade. This means that the styles are applied in the order they are read by the browser. The first style is applied and then the second and so on. What this means is that if a style appears at the top of a style sheet and then is changed lower down in the document, the second instance of that style will be the one applied, not the first. For example, in the following style sheet, the paragraph text will be black, even though the first style property applied is red:

p { color: red; }
p { color: black; } 

The !important directive is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. A rule that has the !important directive will always be applied no matter where that rule appears in the CSS document. So if you wanted to make sure that a property always applied, you would add the !important property to the tag. So, to make the paragraph text always red, from the above example, you would write:

p { color: red !important; }
p { color: black; } 

User Style Sheets

However, the !important directive was also put in place to help web page users cope with style sheets that might make pages difficult for them to use or read. Typically, if a user defines a style sheet to view web pages with, that style sheet will be over-ruled by the web page author's style sheet. But if the user marks a style as !important, that style will overrule the web page author's style sheet, even if the author marks their rule as !important.

This is a change from CSS1 to CSS2. In CSS1, author !important directives took precedence over user !important directives. CSS2 changed this to make the user's style sheet have precedence.


Can You Fix a Background Image to the Bottom of a Table?

Fixing a background image to the bottom of a table works the same way you would fix a background image to the bottom of any other block-level element. You use the background-image, background-repeat, and background-position CSS properties.

First you attach the image to your table:

<table style="background-image: url(image.gif);">

Then you tell the browser not to repeat the image:

<table style="background-image: url(image.gif); background-repeat: no-repeat;">

And finally, you position that image at the bottom of the table:

<table style="background-image: url(image.gif); background-repeat: no-repeat; background-position: bottom;">


How does inheritance work?

HTML documents are structured hierarchically. There is an ancestor, the top level element, the HTML element, from which all other elements (children) are descended. As in any other family also children of the HTML family can inherit their parents, e.g. color or size.

By letting the children inherit their parents a default style can be created for top level elements and their children. (Note: not all properties can be inherited).  The inheritance starts at the oldest ancestor and is passed on to its children and then their children and the children's children and so on.

Inherited style can be overridden by declaring specific style to child element.  For example if the EM element is not to inherit its parent P then own style must be declared to it. For example:

BODY {font-size: 10pt}
All text will be displayed in a 10 point font 
BODY {font-size: 10pt}
H1 {font-size: 14pt} or H1 {font-size: 180%} 

All text except for the level 1 headings will be displayed in a 10 point font. H1 will be displayed in a 14 point font (or in a font that is 80% larger than the one set to BODY). If the element H1 contains other elements, e.g. EM then the EM element will also be displayed in a 14 point font (or 180%) it will inherit the property of the parent H1. If the EM element is to be displayed in some other font then own font properties must be declared to it, e.g:

BODY {font-size: 10pt}
H1 {font-size: 14pt} or H1 {font-size: 180%}
EM {font-size: 15pt} or EM {font-size: 110%} 

The EM element will be displayed in a 15 point font or will be 10% larger than H1. NOTE: EM is, in this example, inside H1 therefore will inherit H1's properties and not BODY's.

The above declaration will display all EM elements in 15 point font or font that is 10% larger than font declared to the parent element. If this specific font is to apply to EM elements but only if they are inside H1 and not every occurrence of EM then EM must take a form of a contextual selector.

H1 EM {font-size: 15pt} or H1 EM {font-size: 110%}

In the example above EM is a contextual selector. It will be displayed in specified font only if it will be found in the context of H1.

Not all properties are inherited. One such property is background. However, since it's initial value is transparent the background of the parent element will shine through by default unless it is explicitly set.


How can I create a variable-width container without a table?

Unfortunately, this is one situation where browser support isn't consistent. This is an effect of tables themselves, so Web browsers should act this way when you set the display to "table" ie:

<div style="background:#cfc;border:double #c8c 5px;padding:0 1em; display: table;"> 

When rendered, this box is exactly as wide as it needs to be.

But Internet Explorer doesn't render it correctly (Firefox, Safari, and Opera do).

According to the IEBlog "display:table is not part of the IE7 release. We know it is a highly requested feature and it is on our "to do" list."

One thing to remember however, is that this is a fairly rare occurrence that you would want the block to vary with the width of the content. If you have a design that requires that functionality and you can't get around it by setting percentage widths or other functions, then you should use a table. But this is not a good enough reason to refuse to move to CSS for layout.


Rounded Corners Using CSS and No Images

Rounded corners rely on the fact that computer monitors and our eyes are not that good at viewing what are effectively tiny squares (the pixels). So if you set up a series of pixels along the edges of your elements, you can line them up in such a way that they make the box they are edging appear to have rounded edges. For example, this page demonstrates how you can set up rounded corners on various div elements.

To create the rounded corners, you need an inline element that acts as the actual pixel for your corner. This could be any inline element, but I prefer either the span element or the b element. Span because it's probably the most "correct" element to use, and b because it's shorter to type and you should be using strong for your bolded text.

You also need a container element, such as a div. You could also use an unordered list as your container, or any other block-level element, but the div seems to be the easiest to understand, and you can include other block elements inside a div, which you can't inside, say, a paragraph.

The XHTML Required for Rounded Corners

<div class="container">
 <b class="rtop"><b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b></b>
 <b class="rbottom"><b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b></b>

In order for your corners to show up, you need to have your container div be a of a different color than the background color of the page. So, the first thing your style sheet should have is a style indicating what color your rounded elements will be:

.container {
margin:0 15px;

As you can see, I also set the left and right margins a little off the edges so that they would be easier to see the rounded corners.

Each corner is written as a b element classed either rtop or rbottom. Then inside of this element are 4 more b elements, classed r1 through r4. To get the correct colors, you need to set the rtop and rbottom elements the same as the page background color. Then you set the r1 through r4 elements the same background color as the container.

.rtop, .rbottom{
 .rtop *, .rbottom *{
display: block;
height: 1px;
overflow: hidden;

Setting the overflow to hidden ensures that the elements inside rtop and rbottom won't extend past their allotted space.

The last thing you do is set the right and left margins of the r1 through r4 elements so that they get progressively smaller and create the curve you're looking for.

.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}

The height on the r4 element helps insure that the entire section doesn't take up too much space.

Where The Rounded Corners Work

Rounded corners done in this style will work on the following types of elements:

  • floated elements
  • absolutely positioned elements
  • fixed width elements
  • percentage width elements

Where The Rounded Corners Don't Work

You can't use this exact style with a fixed height or with padding on the container element. But you can solve that problem by creating a second container element that assigns your height or padding.

This technique doesn't work on IE 5.x for Windows.

There are also some problems with text-indent in Internet Explorer.

The Full CSS for Rounded Corners

.container {background:#ccc; color:#fff; margin:0 15px;}
 .rtop, .rbottom{
 .rtop *, .rbottom *{
display: block;
height: 1px;
overflow: hidden;
 .r1{margin: 0 5px}
 .r2{margin: 0 3px}
 .r3{margin: 0 2px}
margin: 0 1px;
height: 2px


How Do you Stretch a Background Image in a Web Page?

The best way to stretch an image to fit the background of a page is to use the CSS3 property background-size :

body {
  background: url(bgimage.jpg) no-repeat;
  background-size: 100%;

According to caniuse.com it works in IE 9+, Firefox 4+, Opera 10.5+, Safari 5+, Chrome 10.5+, and on all the major mobile browsers.


What is CSS rule ‘ruleset’?

There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector or selectors and declares style which is to be attached to that selector or selectors. For example P {text-indent: 10pt} is a CSS rule. CSS rulesets consist of two parts: selector, e.g. P and declaration, e.g. {text-indent: 10pt}.

P {text-indent: 10pt} - CSS rule (ruleset)
{text-indent: 10pt} - CSS declaration
text-indent - CSS property
10pt - CSS value


What is alternate Style Sheet? How to link?

Alternate Style Sheet is a sheet defining an alternate style to be used in place of style(s) declared as persistent and/or preferred.

Persistent style is a default style that applies when style sheets are enabled but can disabled in favor of an alternate style, e.g.:

<LINK REL=Stylesheet HREF="style.css" TYPE="text/css">

Preferred style is a default style that applies automatically and is declared by setting the TITLE attribute to the LINK element. There can only be one preferred style, e.g.:

<LINK REL=Stylesheet HREF="style2.css" TYPE="text/css" TITLE="appropriate style description">

Alternate style gives an user the choice of selecting an alternative style – a very convenient way of specifying a media dependent style. Note: Each group of alternate styles must have unique TITLE, e.g.:

<LINK REL="Alternate Stylesheet" HREF="style3.css" TYPE="text/css" TITLE="appropriate style description" MEDIA=screen>
<LINK REL="Alternate Stylesheet" HREF="style4.css" TYPE="text/css" TITLE="appropriate style description" MEDIA=print>

Alternate stylesheets are not yet supported.


HTML5 (14)

Have any HTML elements changed their meaning or how they are used?

Yes, but not many. The small element, which in HTML4 has no semantic value—it just means make the text smaller—is used in HTML5 to markup disclaimers, legal notices and the like—the small print. The anchor element, which creates hyperlinks, can now enclose any other elements excluding other links and buttons. In HTML4, the anchor was strictly an inline element.


What exactly is HTML5 Video?

Nothing, really. The term HTML5 video is used to differentiate the playing of a video directly by a browser encountering a web page’s video element, as opposed to being played by a third-party browser plugin via an object or embed element. There is nothing intrinsic about any video that makes it HTML5-ish as opposed to Flash-ish. The distinction is entirely a matter of how the a web page is coded to present the video.


Is HTML5 is a threat to Microsoft?

No. Microsoft embraces HTML5. The IE9 beta has received high marks for its HTML5 support. Silverlight is not the only path to interactivity in Redmond


Where can I get an HTML5 browser?

Opera, Chrome and Safari provide pretty solid support for HTML5 in their current versions including their browsers for iPhones, iPads and Droids. Firefox’s support for HTML5 is weak in its current version (3.6) but quite robust in the Firefox4 public beta.


How does HTML5 affect my existing HTML4 website?

It doesn’t. The HTML5 specifications require browser makers to support valid HTML4 web pages. You should update your HTML editing tools when new versions are available. If your web pages require a diet of strict xhtml, you should validate any third-party HTML5 code to one of the xhtml standards before embedding that code into your own pages.


Is HTML5 ready for prime time?

Some of it is and some of it isn’t. New HTML5 semantic elements have good support in all modern browsers, including IE if an HTML5 shim or the Modernizer JavaScript library is loaded into a web page. The audio, video and canvas elements are not supported in Internet Explorer yet, but these elements are designed to gracefully fail and fallback to other technologies, like Flash and Silverlight, in legacy browsers. Other technologies that are associated with HTML5 such as Mathematical Markup Language (MathML), Scalable Vector Graphics (SVG), Web Sockets, Web Storage and Geo-location have only limited support in the current crop of browsers.


Is HTML5 video better than Flash video?

Yes, but not in terms of video quality which is a function of how the video data is encoded. HTML5 video is better because the video element can interact with other elements on the page and can be styled using CSS. Also, HTML5 video should use less resources because it is built into the browser.


What about Internet Explorer?

Internet Explorer is late to the HTML5 party. There’s no HTML5 support in IE8 or previous versions. However, adding a JavaScript library such as Google’s HTML5 shim or Modernizer enables IE 6, 7 & 8 to recognize the new semantic level elements so they can be styled with CSS. HTML5 support is good in the beta version of IE9 which is available for Windows Vista and Seven users. Unfortunately, the Windows 7 mobile browser is built largely on the IE7 code base.


Are there new HTML5 tags?

Yes, there are new HTML5 elements that provide richer semantic descriptions of documents: section, article, header, hgroup, footer, aside and nav; new media elements: audio, video and canvas; new form input types: email, url, number range and search; and a bunch of new element attributes.


Are there things in HTML4 that are not in HTML5?

Yes, but only a handful of elements and these are not really gone; they are just marked as obsolete. Browser makers can continue to support these elements in their new versions and most will. Among the elements marked as obsolete in HTML5 are: frame, frameset, big, center, font, strike, acronym, applet, isindex and dir.


Java (225)

Where does Javascript fit in?

To quote from p. 31 of my book, The Java Developer's Resource,
Java and JavaScript are about as closely related as the Trump Taj Mahal in Atlantic City is to the Taj Mahal in India. In other words Java and JavaScript both have the word Java in their names. JavaScript is a programming language from Netscape which is incorporated in their browsers. It is superficially similar to Java in the same way C is similar to Java but differs in all important respects.


What is Sun Activator?

Sun Activator is a Javasoft written Java VM created to replace the VM in browsers such as IE and Netscape. Sun did this to reduce inconsistencies between the Sun, Microsoft and Netscape Virtual Machines.


How do I use the Vector class, from the java.util package?

Using the Vector class, rather than creating your own linked-list structure is a good idea. Vectors are extremely easy to use, and implement the Enumeration interface which makes traversing the contents of a Vector extremely easy.

Creating a vector is easy. Simply define a variable of type Vector, and call the vector constructor.

// Create an instance of class Vector ....
Vector myVector = new Vector ();

// ... or suggest an initial vector size
myVector = new Vector(50);

Vector instances, like linked-lists, can grow dynamically. Once the vector reaches its maximum limit, it dynamically allocated resources and increases its maximum. However, if you know you're going to insert a large amount of data, you may want to specify an initial estimate.

Vector instances can store any type of object – you simply insert an object via the addElement method.

for (int i = 1; i <= 20; i++)
	myVector.addElement( new String ("I am string " + i));

When you wish to access the elements of the vector, you can look at individual elements (via their offset within the vector which is in ascending order), or you can traverse the entire list.

// Peek at element 5
System.out.println ("Element : " + myVector.elementAt(5) );

Traversing the entire vector is a common opperation. Remember, however, that when you insert an object via the addElement, it is implicitly cast to an instance of Object. Object is the base class of all other Java classes, and you'll need to explicitly cast it to another object type.

// Traverse entire list, printing them all out
for (Enumeration e = myVector.elements(); e.hasMoreElements();)
	String myString = (String) e.nextElement();

Traversing a list is made extremely simple through the use of the Enumeration interface. Enumerations are great, because they allow you to easily process all elements, without having to determine the length of the vector, and manually accessing each element. Instead, it returns all the elements through the nextElement method.

Vectors provide an easy interface, and have the advantage that they can grow dynamically, whereas arrays are of fixed length. Consider using them in your next Java project!


What are the main benefits of the Java EE platform?

  • Developer productivity.  Java EE 6 delivers a plain old java object (POJO) and convention over configuration approach to development.  Developers begin with POJOs and annotate them with additional capabilities, such as transaction-enabled business components (i.e. @Stateless), value constraints with Bean Validation (i.e. @Max), and database persistence (@Entity).  Annotations can virtually replace XML configuration, greatly simplifying development.
  • Feature rich platform.  The Java EE platform provides a rich set of features out of the box, avoiding an explosion of non-standard, non-integrated APIs. The result is a pre-tested, pre-integrated platform offered by multiple vendors.
  • Web Profile.  For applications that do not need the power and enterprise connectivity of the full Java EE platform, Java EE 6 introduced the lightweight Web Profile optimized for web applications.  Developers can rapidly create rich user interfaces that integrate with transactional business components and databases for departmental or outward-facing web applications.
  • Faster solutions delivery time to market.  The Java EE platform uses "containers" to simplify development. Java EE containers provide for the separation of business logic from resource and lifecycle management, which means that developers can focus on writing business logic — their value-add — rather than writing enterprise infrastructure. For example, the Enterprise JavaBeans (EJB) container handles distributed communication, threading, scaling, transaction management, etc. Similarly, Java Servlets simplify web development by providing infrastructure for component, communication, and session management in a web container that is integrated with a web server.
  • Freedom of choice.  Java EE technology is a set of standards that many vendors can implement. The vendors are free to compete on implementations but not on standards or APIs. Oracle supplies a comprehensive Java EE Compatibility Test Suite (CTS) to Java EE licensees. The Java EE CTS helps ensure compatibility among the application server vendors which facilitates portability for the applications and components written for the Java EE platform. The Java EE platform brings Write Once, Run Anywhere (WORA) to the server.
  • Complete web services support.  The Java EE platform provides a framework for developing and deploying web services on the Java platform. The Java API for XML Web Services (JAX-WS) enables Java technology developers to develop SOAP-based interoperable and portable web services. Developers use the standard JAX-WS programming model to develop SOAP-based web service clients and endpoints. A web service endpoint is described using a Web Services Description Language (WSDL) document. JAX-WS enables clients to invoke web services developed across heterogeneous platforms. In a similar manner, JAX-WS web service endpoints can be invoked by heterogeneous clients.
  • By offering one platform with faster solution delivery time to market, freedom of choice, and simplified connectivity, the Java EE platform helps IT by reducing Total Cost of Ownership (TCO) and simultaneously avoiding single-source lock-in for their enterprise software needs.


What exactly are Java Beans?

Java Beans are components that can be used to assemble a larger Java application. Beans are classes that have properties, and can trigger events.

To define a property, a bean author provides accessor methods, that can get and set the value of a property. A bean tool should inspect the class for methods matching the get/set pattern, and allow you to modify the object's properties.

public class MyFirstBean
	private String name;

	public MyFirstBean()
		name = new String("MyFirstBean");

	public String getName()
		return name;

	public void setName( String newName )
		name = newName;


This is a very simple bean, within minimal functionality. It triggers no events, and has a single property, but does introduce you to the basics of beans.


How do I compare two strings?

A common error that we all make from time to time is incorrect String comparison. Even once you learn how to compare strings correctly, it's extremely easy to make a mistake and use the == operator.

When we compare primitive data types, such as two ints, two chars, two doubles, etc. we can use the == operator. We can also use the == operator to compare two objects. However, when used with an object, the == operator will only check to see if they are the same objects, not if they hold the same contents.

This means that code like the following will not correctly compare to strings :

if ( string1 == string2 )
	System.out.println ("Match found");

This code will only evaluate to true if string1 and string2 are the same object, not if they hold the same contents. This is an important distinction to make. Checking, for example, to see if
aString == "somevalue", will not evaluate to true even if aString holds the same contents.

To correctly compare two strings, we must use the .equals method(). This method is inherited from java.lang.Object, and can be used to compare any two strings. Here's an example of how to correctly check a String's contents :

if ( string1.equals("abcdef") )
	System.out.println ("Match found");

This is a simple, and easy to remember tip that will safe you considerable time debugging applications. Remember – never use the == operator if you only want to compare the string's contents.


What does the keyword ‘static’ mean?

The static keyword denotes that a member variable, or method, can be accessed without requiring an instantiation of the class to which it belongs.

In simple terms, it means that you can call a method, even if you've never created the object to which it belongs! Every time you run a stand-alone application (which requires a static main method), the virtual machine can call the main method without creating a new application object. Of course, unless the application's methods are all static, you will need to create an instance of it at some point.

With regard to member variables, it means that they can be read from, and written to, without creating an object. You may have noticed that many classes create constants that can be read, without creating an object.

static final int VERSION = 2;

Static member variables are shared by all instances of the class to which they belong. When writing classes, this can be a handy feature. Consider the following example, where a counter is used to track how many myObject instantiations have taken place.

public class myObject
	static int objectCount = 0;

	public myObject()

	public String toString()
		return new String ("There are " + objectCount + " objects");

As each new myObject is created, the counter increments. If you were writing an Internet server application, you could track how many concurrent connections existed (remembering that you'd have to include in the destructor or at the end of the connection code a decrement to your count). When used correctly, static member variables and methods can be quite useful!


How can I invest in Java technology on the stock market?

Java technology is a product of Sun Microsystems, Inc., which is traded on NASDAQ under the symbol SUNW.


What are the basic elements of public key encryption?

The four pillars of public key encryption are public/private key pairs, digital certificates, certificate authorities and an encryption algorithm.

Basically, the key pairs provide a means of exchanging messages, encryption algorithms "scramble" the message, digital certificates ensure that the send and receiver are who they claim to be, and the certificate authority ensures the validity of the digital certificates.


When converting older Java software written for JDK1.0 to run on a newer JVM, are there any issues I should be aware of? Are all future versions of Java guaranteed to be backwards compatible?

While there have been significant improvements to the Java platform over the years in the terms of graphics, networking, performance, and other API enhancements, older software can't take advantage of these so many developers find themselves faced with the task of upgrading software. Or, as often happens, a machine running an earlier JVM for some critical application is upgraded, and a newer release is installed. How can you guarantee that there won't be any problems with your older software? Or is it safe to assume that all versions of Java are guaranteed to be backwards compatible?

It's never safe to make any assumption when it comes to JVMs. There are just too many vendors, and too many versions to keep track of. Beyond vendor incompatibilities though, there are some issues to be careful of when moving from JDK1.02 to JDK1.1, and from JDK1.1 to Java 2.

Firstly, and this is the most important, be mindful of deprecated methods. A method that has been marked as deprecated means that Sun no longer recommends using it and that an alternate mechanism should be used if at all possible. Please see an earlier FAQ on this topic located here. Remember also that if you want your new programs to run on older JDK1.0 machines, you must continue to use the deprecated methods and not newer ones that JDK1.0 is not aware of.

Secondly, there are many minor changes to the JDK tools, and JVMs, that will cause problems with older software. Generally this happens because of minor flaws in the original source code of the application, and as the JVM has improved it has become more strict. As a general rule, you shouldn't have much of a problem, but in the documentation that ships for JDK1.2 there are quite a few areas identified where problems can arise with older code. These are listed in the JDK 1.2 compatibility guide (see below).


Joomla (200)

Why shouldn’t I use PHP safe_mode?

Enabling safe_mode is not needed if other reasonable security precautions are followed. Using safe_mode for web site security is a poor compromise in a bad situation. It may make sense in some situations, but there is almost always a better way. Because safe_mode in some sense only gives the illusion of safety, it will be removed from PHP starting with version 6.0.

The Joomla! core works fine with or without PHP safe_mode. The one exception to this rule is the installation script. This is because safe_mode, by design, turns off the PHP functions that enable easy uploading via a Web browser. If you do use safe_mode, and need to perform installs via the Web browser, temporarily turn safe_mode OFF, and turn it back ON when finished.

Some third-party extensions may require the specific PHP functions that are blocked by safe_mode. Such extensions should be carefully evaluated to be sure you understand exactly why they require such powerful and potentially dangerous functions.


What is a content management system (CMS)?

A content management system is software that keeps track of every piece of content on your Web site, much like your local public library keeps track of books and stores them. Content can be simple text, photos, music, video, documents, or just about anything you can think of. A major advantage of using a CMS is that it requires almost no technical skill or knowledge to manage. The CMS manages all your content, so you don't have too.


Why don’t all of my menu items show up in the module assignment lists?

Modules are assigned to specific pages using a list of menu links that is visible when you edit the module in the module manager (on the right of the page). In older versions of Joomla! this list does NOT include menu links of the type "URL." This is an anomaly from the history of the development of Joomla! carried over from Mambo. Although you can use the URL type for any link, including internal Joomla! links, the original idea was that these would be used for links to external sites which would not display Joomla! modules. Some Joomla! component extensions use URL links (rather than component links with parameters) as a simple way to access specific views of the components.


Can you remove the “Powered by Joomla!” message?

Starting with Joomla 1.5 and its move to Internationalization and full support of UTF-8, messages for footer.php and other Joomla pages has been moved to a language specific file.

As before if you want to change the text, go to the language directory, go to the folder of the language you want to change, find the mod_footer.ini file and change the relevant text. For British English, the specific file is language/en-GB/en-GB.mod_footer.ini. Remember that you may not remove copyright and license information from the source code. However note that this means that every time you update Joomla the language file will be overwritten with the old copyright.

A better solution is to create a language string override in the language.
If you want to remove the footer entirely, go to Extensions > Module Manager and unpublish the footer module.

Other places where can look for options to make changes are these. If you find code related to footers in these files, you can either "comment it out" or remove it:

  • /includes/footer.php file.
  • index.php file for your active template


Why can’t you upload files using the flash uploader?

Sometimes the flash uploader does not work.

There are known issues with the Flash Uploader and Flash 10. At this time it is recommended to deactivate the Flash Uploader in the Main Configuration Settings and use the traditional and safe form uploader.


Why are there vulnerable extensions?

Anyone may write and distribute a Joomla! extension. As a service to the global community, this freedom is actively encouraged and supported by the Joomla! Core team. Due to the openness and popularity of the Joomla! project, there are a wide variety of extensions offering a vast array of features. The quality and breadth of Joomla! extensions is one of the main advantages of Joomla.
However this freedom comes with a price. It requires individual responsibility, and can survive only where a majority of participants act responsibly. Joomla's success has led to unwanted attention from malicious types, such as script kiddies who run simple, automated scripts in an effort to find and deface others' Web sites.
It is important to note that, script kiddies unintentionally perform a valuable service. They help us identify vulnerable extensions and poorly configured servers that might otherwise remain open to more serious threats.


Can I suggest some changes to categorization?

Categories in JED are constantly evolving to cope with the increasing amount of extensions. We strive to provide a good categorization to fit all extensions listed in JED. If you feel that an extension deserved to be in another existing or new category, please use the "Report This" button and let us know about your suggestion. You can also post your feedback to our forum.


How do I redirect users after a successful login?

After logging into the Administration backend, go the module manager. A list of all the modules installed on your site will appear. Edit the one that says "Login Form" under Module Name ("mod_login" under the Type column).

Under Parameters, enter the URL of page where you want to redirect successful logins to where it says "Login Redirection URL."


Why doesn’t the pdf of my page show the images?

Images are not supported in Joomla! 1.0.x in the pdf creation script. Images are supported in Joomla! 1.5.


What is a Joomla User Group?

A Joomla User Group (JUG) is a local meeting of people, that regularly share Joomla knowledge, experience and connect with other members of our community. It is a great place to meet new people, and is perfect for all skill levels ranging from newbies, expert Joomla developers, web designers, web managers and anyone wanting to learn more about Joomla.

At the moment there are 168 Registered Joomla User Groups around the world!


Magento (57)

How will you add/remove content from core’s system.xml file?

You can do that by overriding system.xml configuration. Examples:

                    <label>Overriding Catalog Frontend in system config</label>
                       <!--changing cashondelivery payment method settings-->



How Should the Sample of CSV File for Magento Import Look Like?

Magento import to database is the most widespread medium of Magento store content management. It’s preeminent way of appending new products and information associated to them as well as previously disposed at Magento store data renewing. Magento data import is being characterized by bundles of marvellous functions, beneficial for Magento store owners, namely bulk product, image, category, etc upload, precise inventory management, product stock control and so on.
The most prevailing file format, used for Magento import, is csv. Though Magento import from csv is defined as the fastest and most workable way of data upload, it can be really tough nut to crack at times. Magento has strict system of requirements to file data structure, what has essential influence on overall csv to Magento import.
From this follows, to succeed in Magento import from csv and get correct results, you are obliged to smartly structurize comma-separated file. Notwithstanding you are going to update Magento store data or append new products to store database, you have to include certain fields to the file you will upload.
Make sure there are the following columns specified in the file:
SKU (unique product identification)
attribute_set (e.g Default, T-Shirts, Computers )
type (e.g simple, configurable)
status (e.g Enabled)
weight (put “1” if you do not use it)
tax_class_id (None or another tax class, listed in drop-down)
In the event if the file contained above enumerated fields, products will be added at backend after csv to Magento upload. To make them visible at frontend, you should include the following columns to file, used for Magento import:
visibility (Catalog, Search)
quantity (this field is obligatory in case you enabled product stock tracking in the administration area)
To carry out csv to Magento appending swimmingly, you should get well-rounded csv file. In what way to do it?
Create the file with required records by yourself. You can rely upon yourself and, keeping in mind, what fields are required for spotless Magento import from csv, add information to spreadsheet. This is quite a reliable way of csv file creating, although can be tedious and tiresome, especially in case you are going to perform Magento import of vast products amount.
Get file from vendors. You can ask wholesalers to adjust files, they are sending and make them perfect for Magento import. Although, you can’t be certain of file correctness, as suppliers, usually, have a lot of clients with different requirements and they are not eager to hang around file data structurizing.
Export data to the file. You can fall back upon data export to csv file. Having exported just one product, you get the file, including database columns, necessary for Magento import from csv. Nevertheless, the file exported again requires manual changes implementation, as the file, exported by default Magento import method, is not suitable for Magento import to database.
Thus, whatever method of file building up you prefer, you are about to face inconveniences, related to distinct system of requirements to Magento import file. To bypass the difficulties and simplify data upload performing, entrust it to Store Manager for Magento desktop application. With this solution you won’t be bound to rigid scheme of csv file organization and will have a possibility to input values immediately in the course of csv Magento import. In case some fields are missing in the file or improper values are specified, Magento user can easily improve the matters with Store Manager application. Furthermore, updating previously appended to database information, you are not obliged to include all the fields, listed above. Indicate only those fields, which you need to renew (e.g product price, quantity) and product identifier (SKU, Name, ID). One more advantage is that, the application supports the scheme “export file – bring changes to data – import data back to store”, what is unfamiliar for Magento admin import tool.


What is Magento Configurable Product and how to Import Magento Configurable Products?

Magento Configurable Produc is a real finding for both customer as well as store owner. If the product is configurable, it means that the customer can make his purchase more personalized and adapt it according to his needs and requirements by choosing from a list of options available, such as size or color etc. In its turn, with configurable products it is less of headache for store owner, since he/she creates only 1 product with variants available for selection instead of separate ones for all products of different colors or sizes he/she sells.

In general, Magento configurable product consists of the set of simple products which represent product variations. For example, if you have one products T-Shirt and from front-end you can choose its color (green or white) and size (S, M or L), then from Store Manager as well as from the admin side you will see 1 configurable product T-Shirt but with a bulk of simple products associated to it, for instance “T-Shirt green size S”, “T-shirt Green, size M”, “T-shirt white size S” etc.

To import configurable products in bulk you need to make sure that in your .csv file you have all the data correctly organized and placed.

Here's a list of items for you to check in your .csv file before proceeding with the process of configurable products import:

As it was mentioned above, a range of simple products are assigned to configurable product. To import configurable product correctly, please, make sure that you have in the column “Configurable Products” of your .csv file indicated the SKUs of all simple products associated with it. The SKUs should be separated by comma symbol.

  • Besides, please, mind that simple products should be assigned to same attribute set as configurable product.
  • In configurable products (attribute) field you should indicate the attribute code to create variations basing on it. For instance, if you sell shoes of different sizes and colors, then you have to indicate in this field attribute codes of size and color separated with comma. If you have the products of the same size and with no other option to choose, then you can leave one attribute code – size.


Also, please, remember that your .csv file beside of those data, we described above, should contain the required fields that are used to import configurable products to Magento. The combination of fields of your .csv file depends on Magento required attributes (like description, price, qty, etc) as well as on your own required attributes (those that are required for your product specifically and you can set them as required yourself).
If all is correct and your .csv file is ready for import you can proceed with the process of configurable product import itself.


How to install Magento

These instructions document the default installation for Magento. At the end, Magento will be installed without sample data to a directory called magento on your web server. There are four main steps covered here:

  • Step 1 – Download Magento
  • Step 2 – Set file permissions for the Setup Wizard
  • Step 3 – Create your store database
  • Step 4 – Run the web-based Setup Wizard
  • All done!

Step 1—Download Magento

Method 1: Download Magento to your computer and FTP it up to your server

  1. Using a browser, download the latest full release archive file from MagentoCommerce.com ( http://www.magentocommerce.com/download)
  2. On your computer, extract Magento from the downloaded archive. A folder named magentocontaining all of the Magento files will be created
  3. Using an FTP client, upload the extracted magento folder and all its contents to the web root on your web server (usually public_html)

Method 2: Download Magento directly to your server (requires SSH access)

If you have SSH access to your server, using wget to download the archive directly to your server is much faster and simpler than Method 1.

  1. Using SSH, log onto your server and go to the web root directory (usually public_html)
  2. Get the full release archive using the wget command below
  3. On your server, extract Magento from the downloaded archive. A directory named magentocontaining all of the Magento files will be created under  public_html

	cd publc_html wgethttp://www.magentocommerce.com/downloads/assets/ tar -zxvf magento-

(Replace in the commands above with the desired version number. Current and previous version numbers can be seen on the Download page on MagentoCommerce.com)

Step 2—Set file permissions for the Setup Wizard

On your web server, make the directories that the Setup Wizard needs writeable by the web server

Files & directories that must be writeable are:

  • – file: magento/var/.htaccess
  • – directory: magento/app/etc
  • – directory: magento/var
  • – all the directories under: magento/media

If you are using FTP, set the permissions of each to 777 or check read/write/execute for owner, user and group. If you are using SSH, use the following commands:

	chmod o+w var var/.htaccess app/etc
chmod -R o+w media

Step 3—Create your store database

  1. Create an empty MySQL database for your store 
    This step varies by hosting provider and is out of the scope of this document. Consult your System Administrator or your web host’s support/documentation for instructions on how to do this. PHPmyAdmin or the MySQL command line are the most commonly used tools/methods for creating and managing a MySQL database
  2. Create a database user with full privileges to the database
  3. Make note of the database name (dbname), db user (dbuser), db user password (dbpassword)
  4. If you want to load sample data, you must do it now, before you run the setup Wizard in the next step

Step 4—Run the web-based Setup Wizard

  1. Using a browser, run the Setup Wizard 
    Go to your website by domain or IP address http://www.yourDomain.com/magento or http://yourIP.0.0.1/magento) and the Setup Wizard will run automatically
  2. In the Setup Wizard, finish configuring your Magento installation

         a. License Agreement – Read and accept the terms and conditions

         b. Localization (settings can  be changed later via the Admin Panel)

  • Locale – default country $ language
  • Time zone – default time zone
  • Default currency

c. Configuration


  • Host


    for most basic installations

  • Database name


    when you created the database

  • User name


    when you created the database

  • User Password

    when you created the database

Web access options (will be pre-filled based on your installation, settings can be changed later via the Admin Panel)

  • Base URL—for default installation into a magento directory, base URL should be  http://www.yourDomain.com/magento or http://www.yourIP.com/magento . (If you’re installing Magento locally on PC or Mac, this should be –you cannot put “localhost” here unless you’ve previously set it up in your local hosts file.)
  • Admin path—default is “admin” (will be appended to base URL to reach Admin Panel)
  • Skip Base URL Validations Before the Next Step
  • Use Web Server (Apache) Rewrites
  • Use Secure URLs

Session Storage Options—Choose file system or database. Most installations should use “file system” because it’s faster and doesn’t cause the database to grow. But if your site will run on multiple servers, you should select “database” so that a user’s session data is available regardless of which server his/her request is served from.

Admin account

  • Name & contact info for 1st Admin user
  • Login info for 1st admin user (username & password)
  • Encryption key—Database encryption key. If you do not provide one, Magento will automatically generate one. It will be displayed to you and saved in the app/etc/local.xml file.

Magento stores this set up information in the file  app/etc/local.xml. If you’d like to run through the Setup Wizard again you do not have to download all the Magento files again. Just delete the  local.xml file and any files and directories in the var/ directory and go back to  http://www.yourDomain.com/magento&nbsp; with your browser. The Setup Wizard will run automatically again. (Why does this work? The Setup Wizard writes the values you provide during the setup process to the local.xml file and it will not run if it finds a local.xml file already. The var folder contains cached session information from the frontend and will have cached any previous settings, so deleting these files will prevent the incorrect cached content from being used.)


magento installation softaculous

After you finish the set up wizard, you will be redirected to the Magento storefront. You can access the Admin Panel and start adding categories and products.

  • Your frontend store will have the URL  http://www.yourDomain.com/magento
  • Your Admin Panel will have the URL  http://www.yourDomain.com/magento/admin
    (Log in using the username and password you created in the last step of the Setup Wizard)


What Is an Easy Way of Converting Magento Simple Products into Configurable?

Setting up product catalog with Magento you have abundance of tailor-fit features at your disposal, one of which is the possibility to easily create and efficiently manage different types of Magento products at your store. Indicating appropriate product class is significant for accessing apt feature set required to sell your goods.
It’s very important to correctly define what class this or that product will belong to before adding it to Magento product list. Not infrequently, having created/uploaded some items to Magento, you come to the conclusion, that they should refer to different type – let’s say, you have added products as simple, but need them to be configurable ones. For example, you are selling clothing and need to create different options of certain item for customers to choose between (size, color). You, as store owner, can develop more flexible system of inventory control, while your customers will be able to easily find the product they will be looking for.
Thus, the item on the agenda is “How to convert simple products into configurable not messing things up?” Will you prefer to re-add all the entities and specify details? Surely, it will be time-consuming and cumbersome process. It’s also possible to edit database tables and change Magento products type to needed one, what is quite risky, as you can damage Magento database.
Store Manager for Magento offers you a simpler and understandable way of converting simple products into configurables. Product type can be changed by means of corresponding option, available on Magento products toolbar or in the product context menu. Although, to make simple Magento item configurable, you should ensure that attribute set, the product belongs to, has configurable attributes. For that proceed with the following:
Go to Store Manager Attributes section, and then find attribute set, associated to current Magento item in the left pane of Manage Attributes window. Check whether at least one Magento attribute included to this attribute set has Scope field set to “Global” and Catalog Input Type – to “Dropdown”. This is required, as you should have Magento attribute with options to create configurable product. You can create required attribute and assign it to appropriate attribute set in “Manage Attributes” section of the application.
What are further operations?
Having accomplished the preparations, go to Magento product list and select an item you want to convert to configurable.
Call up dialog box, clicking on Change Product Type icon and then select target product type from the drop-down list. Press Ok button to apply alteration.


In Type field of product grid you will see product class turned to configurable.
Just in several clicks you’ve got a configurable product, that can home wide scope of associated products that will create options for your customers. Thus, now you have to add simple products to just created configurable item. You may already have them created and available in Magento product list. To associate items to configurable product proceed with the following:
Select configurable product, then go to Store Manager lower grid and switch to Associated Products tab. On the toolbar/in the context menu you will find “Add associated product” button. Press it to open dialog box. Check boxes for items you want to associate to Magento configurable product. Press Ok button to fulfil the procedure.
On condition that simple Magento products have not been created yet, you can efficiently generate them with Store Manager functionality. Having chosen configurable Magento product and switched to corresponding tab of the lower grid you have, first of all, specify configurable attribute, on the basis of which associated products will be generated. Press “Select Configurable Attributes” button on the toolbar, check the box/boxes for necessary attribute/s and press Ok. Magento attributes being specified, resort to “Create Associated Products” option to generate required simple products.
Use alternative route of changing Magento product types with Store Manager for Magento application – avoid hours of tiresome product re-adding and create customizable product catalog.


What benefits of Magento Enterprise Edition are we using?

It is surprising how many Enterprise Edition users are not taking advantage of full page caching, one of the key features available to improve page load times. Most often, it is turned off because your design (theme) conflicts with it. If that is the case, you should be asking how you can modify your design to allow for it. You should also make sure you your team knows how to segment customers, add banners to timed promotions, set up private sales, stage content and other features unique to Magento Enterprise Edition. It’s important to test, test and test again to determine what works best for your type of products and services.


How to speed up product imports and exports in Magento

Magento product imports and exports tend to gradually slow down. The reason for this usually is that the Magento database fills up with records and the larger it becomes, the slower product imports and exports become.

Fortunately, there is an easy solution. To reduce the database size and speed up product imports and exports, you can delete old records by truncating a few tables. The tables that need to be truncated are log_url, log_url_info, log_visitor, log_visitor_info, dataflow_batch_import,dataflow_batch_export, index_event and report_event.

You can truncate these tables through phpMyAdmin. Simply tick the 8 tables and from the With selected drop-down menu at the bottom of the page select Empty.

An alternative of the above is to click the SQL tab in phpMyAdmin, paste these queries:

TRUNCATE `log_url`; TRUNCATE `log_url_info`; TRUNCATE `log_visitor`; TRUNCATE `log_visitor_info`;  TRUNCATE `dataflow_batch_import`; TRUNCATE `dataflow_batch_export`; TRUNCATE `index_event`;   TRUNCATE `report_event`;

and click the Go button to execute them.

It is also recommended that you set up log cleaning in Magento so that your Magento can purge its logs automatically.


Which version of Magento should we be using?

If you're more than 1 version behind the latest Magento release, you may be missing out on some important features or security patches if you are running an older version. Visit the Magento web site to see the latest version of Enterprise Edition. If you are more than one version behind, you should ask why.


Basic Features of Magento

Magento is an open ecommerce source platform which is powerful and has many applications. It provides all features and tools to build ecommerce website as quick as possible.

There are features which Magento Tutorial for Beginners summarized:

  •  Analytics and Reporting – the script is integrated with Google Analytics and offers many different reports.

  • Product Browsing – multiple images for products, options for extensive reviews, wishlists and much more.

  • Catalog Browsing – easy navigation, advanced product filtering system, product comparison.

  • Catalog Management – inventory management, batch import and export of products, different tax rates per location, additional product attributes.

  • Customer Accounts – order status and history, e-mail and RSS feeds for products in the wishlist, newsletter subscription, default billing and shipping address.

  • Customer Service – enhanced features for customers’ accounts, Contact Us form, comprehensive order tracking and history, customizable order e-mails.

  • Order Management – create orders through admin area, create multiple invoices shipments and credit memos, call center order creation option.

  • Payment – different payment methods: credit cards, PayPal, Authorize.net, Google Checkout, checks, money orders, support of external payment modules like Cybersource, ePay, eWAY and many more.

  • Shipping – shipping to multiple addresses, flat rating shipping, supports UPS, UPS XML (account rates), FedEx (account rates), USPS and DHL.

  • Checkout – one page checkout, SSL support, checkout without having an account.

  • Search Engine Optimization – 100% Search Engine Friendly, Google SiteMap support.

  • International Support – multiple languages and currencies, list of allowed countries for registration, purchasing and shipping, localization.

  • Marketing Promotions and Tools – coupons, discounts and different promotion options.

  • Site Management – control of multiple web sites, multiple languages, tax rate with support for US and International markets, customizable outlook through templates.


How many database tables will Magento create when you make a new EAV module?

Magento creates 6 tables when you create new EAV module. Tables: module, module_datetime, module_decimal, module_int, module_text and module_varchar. one is the main entity table, and rest 5 tables which holds attribute’s data in different data types. So that integer values will go to module_int table, price values to module_decimal, etc.


Magento Go (14)

Can I Customize The Design of My Store?

Yes, Magento Go gives you lots of options for designing your store. You can start with one of many professional themes and then customize them to meet your needs. You can upload your own logo and images, edit the theme's CSS or even upload your own CSS file. You can even upload JavaScript blocks into your design. Magento Go makes it very easy to achieve your desired look and feel of your store without sacrificing functionality.


What Are Store Views and How Many May I Use For My Store?

Store views are used to support multiple languages in Magento. They can also be used to create different areas of the website that are styled differently, all under the same base URL. The number of languages supported by a plan are the number of store views that are available with that plan. Please refer to the Plans and Pricing page for details.


Can I Run Multiple Sites From a Single Store?

At present, you can run one website that is associated with a single base URL with each Go plan you purchase.


How do Add-ons Work?

Add-ons leverage Magento Go's web services Application Programming Interfaces (APIs) to seamlessly connect with our partners' systems to exchange information. The data is then imported from the partner directly into Magento Go's control panel for you to easily access.


Can I use My Own Domain?

Yes. Magento lets you customize your online store with your own domain name on any Magento Go plan. Once you have purchased a plan, you can add your own domain to your store through your Account Settings. Please follow the instructions in the Magento Go Knowledge Base to add your own domain to your Magento Go online store.


Can I migrate my existing catalog to my Magento Go Store?

Yes, Magento Go lets you import your existing catalog by uploading a .CSV file. Magento will soon provide you with automated tools to migrate your catalog to Magento Go with just a few clicks.


Do You Charge a Set Up Fee for Magento Go?

No, Magento Go plans do not have any set up fees.


Does Magento Sell Domain Names and SSL Certificates?

At this time, Magento Go does not directly sell domain names but we do offer a variety of industry-leading custom SSLs through VeriSign. If you would like to learn more about our SSL offerings, visit the SSL page.


What are Add-ons?

Add-ons are a group of marketing and business management products that you can easily integrate with your Magento Go online store. Add-ons were developed through our broad network of partners to give you the flexibility to build and maintain your store the way you want.


How do I Integrate Add-ons?

On the Add-ons page, simply select the Add-on you'd like to integrate and click the 'get this Add-on' link for easy to understand instructions on how to start using your new functionality.


MySQL (116)

How can I restore MySQL database?

The simplest solution is to stop the database, remove the contents of datadir/mysql directory and move there all the files from datadir/mysql_old (or copy preserving owner/group/permissions). Then start the server again.


How to compare data of two tables of two different databases in MySQL?

The UNION operator in MySQL can help you to compare data of two tables of two different databases. The following query unions the queries for matching column names and their values from two tables and keeps just those rows which occur once in the each table. Those are the rows unique to one table or the other. In your SELECT you would customize your columns something like { customer_id, customer_fname, customer_lname, customer_email, customer_phone, …} or as desired:

  MIN(customer) AS customer, customer_id, customer_fname, customer_lname,
		   customer_email, customer_phone

  SELECT 'customer_table_first_db' AS customer, first_table.customer_id,
	  first_table.customer_fname, first_table.customer_lname, 
  FROM first_db.customer AS first_table


  SELECT 'customer_table_second_db' AS customer,second_table.customer_id, 
	  second_table.customer_fname, second_table.customer_lname,
	  second_table.customer_email, second_table.customer_phone
  FROM second_db.customer AS second_table

) AS temp_table
GROUP BY customer_id, customer_fname, customer_lname, 
	 customer_email, customer_phone
ORDER BY customer,customer_id; 

To get similar records from both the tables, you can change the above query as below:

  MIN(customer) AS customer, customer_id, customer_fname,
      customer_lname, customer_email, customer_phone

  SELECT 'customer_table_first_db' AS customer, 
  FROM first_db.customer AS first_table


  SELECT 'customer_table_second_db' AS customer,
	  second_table.customer_id, second_table.customer_fname,
	  second_table.customer_lname, second_table.customer_email,
  FROM second_db.customer AS second_table
) AS temp_table
GROUP BY customer_id, customer_fname, customer_lname,
	 customer_email, customer_phone
ORDER BY customer,customer_id;


What is difference between \g and \G characters in mysql client program?

MySQL allows several queries to be entered on a single input line and uses the terminators to distinguish where each query ends. You may use any of several terminators to end a statement. Two terminators are the semicolon character (';') and the \g sequence. They're equivalent and may be used interchangeably.

The \G sequence also terminates queries, but causes mysql to display query results in a vertical style that shows each output row with each column value on a separate line.

The \G terminator is especially useful if a query produces very wide output lines because vertical format can make the result much easier to read. Take an example below.

mysql>  SELECT * FROM user\G


Why my update query works slow in MySQL?

My update query works slow. The sample Table is as follows:

CREATE TABLE `project` 
	( `id` int(11) NOT NULL, `score` double NOT NULL, 
	  `project_rank` int(11) NOT NULL, PRIMARY KEY (`id`) 

The process takes long time to update. Any idea to speed up this query.

The table has 2M rows when I run the following query:

SET @rank:=0;
UPDATE project SET project_rank=@rank:=rank+1 ORDER BY score DESC, id;

You may apply following tricks:

Check what happens if you drop the index when you do the update? Does it run faster? If so then the index is slowing you down. In this case you should increase the key_buffer_size to 756M.

If there isn’t much difference, try the update without the “ORDER BY” clause. If it runs considerably faster, then you need to increase your sort_buffer_size.


ERROR 1064 (42000): You have an error in your SQL syntax

Your above query contains reserved words in it those are causing error 1064 (42000). ORDER is a reserved word in MySQL and in standard SQL as well. If the column name in the table is ORDER, then put backquotes (`) around the word ORDER when using it as a column name. For Example:

INSERT INTO sections (`order`,edit,remove,section,type) 

Best practice: Don't use reserved words for object (table, column,) or to use backquotes beside every column you used like:

INSERT INTO sections (`order`,`edit`,`remove`,`section`,`type`) 


How are aggregate functions in MySQL?

Aggregate functions perform summary operations on a set of values, such as counting, averaging, or finding minimum or maximum values. Aggregate functions often are used in conjunction with a GROUP BY clause to arrange values from a result set into groups. In this case, the aggregate function produces a summary value for each group.

Grouping can be based on the values in one or more columns of the selected rows. For example, the Country table indicates which continent each country is part of, so you can group the records by continent and calculate the average population of countries in each continent:

SELECT Continent, AVG(Population) FROM Country GROUP BY Continent;

Functions such as AVG() that calculate summary values for groups are known as "aggregate" functions because they're based on aggregates or groups of values. There are several types of aggregate functions. Those discussed here are as follows:

  • MIN() and MAX() find smallest and largest values.
  • SUM() and AVG() summarize numeric values to produce sums (totals) and averages.
  • COUNT() counts rows, values, or the number of distinct values.
  • GROUP_CONCAT() concatenates a set of strings to produce a single string value.

Aggregate functions may be used with or without a GROUP BY clause that places rows into groups. Without a GROUP BY clause, an aggregate function calculates a summary value based on the entire set of selected rows. (That is, MySQL treats all the rows as a single group.) With a GROUP BY clause, an aggregate function calculates a summary value for each group. For example, if a WHERE clause selects 20 rows and the GROUP BY clause arranges them into four groups of five rows each, a summary function produces a value for each of the four groups.

The MIN() and MAX() Aggregate Functions

MIN() and MAX() are comparison functions. They return smallest or largest numeric values, lexically first or last string values, and earliest or latest temporal values. The following queries determine the smallest and largest country populations and the lexically first and last country names:

mysql> SELECT MIN(Population), MAX(Population) FROM Country;
| MIN(Population) | MAX(Population) |
|               0 |      1277558000 |

mysql> SELECT MIN(Name), MAX(Name) FROM Country;
| MIN(Name)   | MAX(Name) |
| Afghanistan | Zimbabwe  |

For string values, the behavior of MIN() and MAX() depends on whether the strings are non-binary or binary. Consider a table t that contains the following string values:

mysql> SELECT name FROM t;
| name   |
| Calvin |
| alex   |

If the name column has a non-binary string data type such as CHAR or TEXT, MAX(name) determines which value is greatest based on the string collation. For the default case-insensitive collation of latin1_swedish_ci, MAX() returns 'Calvin' because 'c' is greater than 'a':

mysql> SELECT MAX(name) FROM t;
| MAX(name) |
| Calvin    |

If the name column has a binary string data type such as BINARY or BLOB, its values are compared using the numeric values of the bytes in the strings. If 'C' has a smaller numeric value 'a' (as is true if characters are stored using ASCII codes), MAX(name) returns 'alex':

mysql> ALTER TABLE t MODIFY name BINARY(20);

mysql> SELECT MAX(name) FROM t;
| MAX(name) |
| alex      |

It is to be noted that MIN() and MAX() ignore NULL values.

The SUM() and AVG() Aggregate Functions

The SUM() and AVG() functions calculate sums and averages. For example, the Country table in the world database contains a Population column, so you can calculate the total world population and the average population per country like this:

mysql> SELECT SUM(Population), AVG(Population) FROM Country;
| SUM(Population) | AVG(Population) |
|      6078749450 |   25434098.1172 |

SUM() and AVG() are most commonly used with numeric values. If you use them with other types of values, those values are subject to numeric conversion, which might not produce a sensible result.

It is to be noted that SUM() and AVG() ignore NULL values.

The COUNT() Aggregate Function

The COUNT() function can be used in several ways to count either rows or values. To illustrate, the examples here use the following table that has several rows containing various combinations of NULL and non-NULL values:

mysql> SELECT i, j FROM t;
| i    | j    |
|    1 | NULL |
| NULL |    2 |
|    1 |    1 |
|    1 |    1 |
|    1 |    3 |
|    1 | NULL |

COUNT() may be used as follows:

  • COUNT(*) counts the total number of rows:

    mysql> SELECT COUNT(*) FROM t;
    | COUNT(*) |
    |        7 |
  • COUNT(expression) counts the number of non-NULL values of the given expression. It's common for expression to be a column name, in which case COUNT() counts the number of non-NULL values in the column:

    mysql> SELECT COUNT(i), COUNT(j) FROM t;
    | COUNT(i) | COUNT(j) |
    |        5 |        4 |
  • COUNT(DISTINCT expression) counts the number of distinct (unique) non-NULL values of the given expression. expression can be a column name to count the number of distinct non-NULL values in the column:

    |                 1 |                 3 |

    It's also possible to give a list of expressions separated by commas. In this case, COUNT() returns the number of distinct combinations of values that contain no NULL values. The following query counts the number of distinct rows for which neither i nor j is NULL:

    mysql> SELECT COUNT(DISTINCT i, j) FROM t;
    | COUNT(DISTINCT i, j) |
    |                    2 |

The GROUP_CONCAT() Function

The purpose of the GROUP_CONCAT() function is to concatenate column values into a single string. This is useful if you would otherwise perform a lookup of many rows and then concatenate them on the client end. For example, the following query displays the languages spoken in Thailand, one per line:

mysql> SELECT Language FROM CountryLanguage WHERE CountryCode = 'THA';
| Language |
| Chinese  |
| Khmer    |
| Kuy      |
| Lao      |
| Malay    |
| Thai     |

To concatenate the values into a single string, use GROUP_CONCAT():

mysql> SELECT GROUP_CONCAT(Language) AS Languages FROM CountryLanguage WHERE CountryCode = 'THA';
| Languages                        |
| Chinese,Khmer,Kuy,Lao,Malay,Thai |

GROUP_CONCAT() supports several modifiers:

  • The default string separator used by GROUP_CONCAT() is ',' (comma). To change the separator, use a SEPARATOR clause:

    mysql> SELECT GROUP_CONCAT(Language SEPARATOR ' - ') AS Languages
           FROM CountryLanguage WHERE CountryCode = 'THA';
    | Languages                                  |
    | Chinese - Khmer - Kuy - Lao - Malay - Thai |
  • GROUP_CONCAT() adds strings to the result in the order in which the database server reads them. To change the concatenation order, add an ORDER BY clause. You can specify ASC or DESC to control the direction of sorting, just as when you use ORDER BY in other contexts:

    mysql> SELECT GROUP_CONCAT(Language ORDER BY Language DESC) AS Languages
    	      FROM CountryLanguage WHERE CountryCode = 'THA';
    | Languages                        |
    | Thai,Malay,Lao,Kuy,Khmer,Chinese |
  • DISTINCT removes duplicates from the set of concatenated strings. The following two statements both select the languages spoken in North and South Korea, but the second statement eliminates duplicates:

    mysql> SELECT GROUP_CONCAT(Language) AS Languages
           FROM CountryLanguage WHERE CountryCode IN('PRK','KOR');
    | Languages                     |
    | Chinese,Korean,Chinese,Korean |
    mysql> SELECT GROUP_CONCAT(DISTINCT Language) AS Languages
           FROM CountryLanguage WHERE CountryCode IN('PRK','KOR');
    | Languages      |
    | Chinese,Korean |

It is to be noted that GROUP_CONCAT() ignores NULL values.

Aggregation for NULL Values or Empty Sets

In general, aggregate functions ignore NULL values. The exception is COUNT(), which behaves as follows:

  • COUNT(*) does not ignore NULL values because it counts rows, even those that contain NULL values.
  • COUNT(expression) and COUNT(DISTINCT) do ignore NULL values.

A SELECT statement might produce an empty result set if the table is empty or the WHERE clause selects no rows from it. If the set of values passed to an aggregate function is empty, the function computes the most sensible value. For COUNT(), the result is zero. But functions such as MIN(), MAX(), SUM(), AVG(), and GROUP_CONCAT() return NULL. They also return NULL if a non-empty result contains only NULL values. These behaviors occur because there is no way for such functions to compute results without at least one non-NULL input value.


How to remove or drop indexes in MySQL?

MySQL allows to drop existing INDEXES and PRIMARY KEYs.  For this MySQL provides ALTER TABLE and DROP statements. You can use ALTER TABLE statement to drop "normal" or "unique" indexes.

Syntax to drop an index by ALTER TABLE statement is like below:

ALTER TABLE tablename DROP INDEX index_name;

Take an example to drop an existing index:

ALTER TABLE buyers DROP INDEX fname_index;

To drop a primary key via ALTER TABLE syntax would be like below:


Take an example to drop primary key:



How to set conditions on query data with CASE construct?

Control flow functions enable you to choose between different values based on the result of an expression. The CASE construct is not a function, but it too provides flow control. It has two forms of syntax. The first looks like this:

CASE case_expr
  WHEN when_expr THEN result
  [WHEN when_expr THEN result] ...
  [ELSE result]

The expression case_expr is evaluated and used to determine which of the following clauses in the rest of the CASE to execute. The when_expr in the initial WHEN clause is evaluated and compared to case_expr. If the two are equal, the expression following THEN is the result of the CASE. If when_expr is not equal to case_expr, and there are any following WHEN clauses, they are handled similarly in turn. If no WHEN clause has a when_expr equal to case_expr, and there is an ELSE clause, the expression in the ELSE clause becomes the CASE result. If there is no ELSE clause the result is NULL. In the following example, CASE expression returns a string that indicates full name of language against each language_id available in the table:

mysql> SELECT CASE languageId
    ->        	WHEN 1 THEN 'English'
    ->         	WHEN 2 THEN 'French'
    ->         	WHEN 3 THEN 'Arabic'
    ->         	WHEN 4 THEN 'dutch'
    ->        ELSE 'Urdu'
    ->        END AS Language
    -> FROM language;
| Language |
| English  |
| French   |
| Arabic   |
| dutch    |
4 rows in set (0.02 sec)

The second CASE syntax looks like this:

  WHEN when_expr THEN result
  [WHEN when_expr THEN result] ...
  [ELSE result]

For this syntax, the conditional expression in each WHEN clause is executed until one is found to be true, and then its corresponding THEN expression becomes the result of the CASE. If none of them are true and there is an ELSE clause, its expression becomes the CASE result. If there is no ELSE clause the result is NULL.  The following CASE expression tests whether the value of the @val user variable is NULL or less than, greater than, or equal to 0:

mysql> SET @val = NULL;
    ->   WHEN @val IS NULL THEN '@val is NULL'
    ->   WHEN @val < 0 THEN '@val is less than 0'
    ->   WHEN @val > 0 THEN '@val is greater than 0'
    ->   ELSE '@val is 0'
    -> END AS result;
| result       |
| @val is NULL |


What does NULL value mean in MySQL?

NULL is unusual because it doesn't represent a specific value the way that numeric, string, or temporal values do. Instead, NULL stands for the absence of a known value. The special nature of NULL means that it often is handled differently than other values. This section describes how MySQL processes NULL values in various contexts.

Syntactically, NULL values are written in SQL statements without quotes. Writing NULL is different from writing 'NULL' or "NULL". The latter two values are actually strings that contain the word "NULL". Also, because it is an SQL keyword, NULL is not case sensitive. NULL and null both mean "a NULL value," whereas the string values 'NULL' and 'null' may be different or the same depending on whether they are non-binary or binary strings.

Note that some database systems treat the empty string and NULL as the same value. In MySQL, the two values are different.

Use of NULL values in arithmetic or comparison operations normally produces NULL results:

mysql> SELECT NULL + 1, NULL < 1;
| NULL + 1 | NULL < 1 |
|     NULL |     NULL |

Even comparing NULL to itself results in NULL, because you cannot tell whether one unknown value is the same as another:

mysql> SELECT NULL = 1, NULL != NULL;
| NULL = 1 | NULL != NULL |
|     NULL |         NULL |

LIKE evaluates to NULL if either operand is NULL:

mysql> SELECT NULL LIKE '%', 'abc' LIKE NULL;
| NULL LIKE '%' | 'abc' LIKE NULL |
|          NULL |            NULL |

The proper way to determine whether a value is NULL is to use the IS NULL or IS NOT NULL operators, which produce a true (non-zero) or false (zero) result:

|            1 |                0 |

You can also use the MySQL-specific <=> operator, which is like = except that it works with NULL operands by treating them as any other value:

mysql> SELECT 1 <=> NULL, 0 <=> NULL, NULL <=> NULL;
| 1 <=> NULL | 0 <=> NULL | NULL <=> NULL |
|          0 |          0 |             1 |

ORDER BY, GROUP BY, and DISTINCT all perform comparisons implicitly. For purposes of these operations, NULL values are considered identical. That is, NULL values sort together, group together, and are not distinct.

Expressions that cannot be evaluated (such as 1/0) produce NULL as a result. However, in the context of inserting data into tables, division by zero can be treated as an error to prevent invalid data from being entered. This behavior is controlled by setting the SQL mode to enable strict mode in conjunction with the ERROR_FOR_DIVISION_BY_ZERO mode.


How can I change URL directly in the database?

If you know how to access phpMyAdmin on your host, then you can edit these values directly to get you up and running again.

  1. Backup your database and save the copy off-site.

  2. Login to phpMyAdmin.

  3. Click the link to your Databases.

  4. A list of your databases will appear. Choose the one that is your WordPress database.

  5. All the tables in your database will appear on the screen.

  6. From the list, look for wp_options. Note: The table prefix of wp_ may be different if you changed it when installing.

  7. Click on the small icon indicated as Browse.

  8. A screen will open with a list of the fields within the wp_options table.

  9. Under the field option_name, scroll down and look for siteurl.

  10. Click the Edit Field icon which usually is found at the far left at the beginning of the row.

  11. The Edit Field window will appear.

  12. In the input box for option_value, carefully change the URL information to the new address.

  13. Verify this is correct and click Go to save the information.

  14. You should be returned to your wp_options table.

  15. Look for the home field in the table and click Edit Field. Note: There are several pages of tables inside wp_options. Look for the> symbol to page through them.

  16. In the input box for option_value, carefully change the URL information to the new address.

  17. Verify this is correct and click Go to save the information.


OsCommerce (22)

How do I change Top in the breadcrumb?

The normal installation of osCOmmerce has Top -> Catalog displayed in the breadcrumb trail The suggested way to change this is to make just state Home. The following instructions will accomplish this: -Open the includes/languages/english.php file in your editor. -Find the line that contains HEADER_TITLE_CATALOG -Change that line so it looks like this: define('HEADER_TITLE_CATALOG', 'Home'); -Open the includes/application_top.php file in your editor, find the code $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER); and remove it.


I don’t see LinkPoint as an option during checkout

You need to log into the administration for Oscommerce, the following is an example URL address:
Click on Modules Click on LinkPoint, then connect and click on the edit button. Make sure payment zone is set to "None".


Customizing OsCommerce Catalog

The next step is to add categories that will contain the products you will be selling in your store. To do that, please open the Catalog category from the administrator's index page and click on Categories/Products. You will be taken to a page where the default categories are being displayed. You will be able to edit or delete an existing category, or add a brand new one.

After clicking the New category button the page will refresh and a box for the new category name will appear in the right column.

Since osCommerce is a multi-language shopping cart you can add category names for the installed languages. You can also select an image to represent the specific category (images are optional and you can ignore warnings for a missing image). It can be uploaded from your local computer. The last thing to do before clicking the Save button is to select the order number for the category. The lower the number – the higher in the list your new category will appear (zero will represent the top of the list).

Next you should add a product to your new category. Open it and click on New Product.

Select whether you have the product in stock or not. Then pick the availability date and the manufacturer. Type in the name of the product on the languages you have installed and decide whether the item is taxable or not; select the Net and the Gross prices.

Enter the product description, the quantity of the product and its model. Images can also be uploaded from your local computer – osCommerce automatically creates a thumbnail. If you are linking to an external product page, please enter the address without the http:// part for the specific languages. Last thing to add is the product weight, since this will help in determining the shipping costs. When done, hit the Save button to keep the product or Cancel to skip this entry.

When you insert the product, you will be taken to the category/product list. If you wish to move the product in another category, click on Move, select the desired category from the drop-down list and click the Move button again.

You will be able to see the new addition at the top of your product list when you visit the store. The new item will also increase the count of items in the chosen category.


How to add a banner in osCommerce?

You can easily add a custom banner to your osCommerce shop from the application’s admin area > Tools > Banner Manager


How can I see the exact version of my osCommerce?

In order to check the version of your osCommerce, you should open theincludes/application_top.php file located in your osCommerce installation folder.

Look for these two lines:

	// define the project version
  define(‘PROJECT_VERSION’, ‘osCommerce Online Merchant v2.2 RC2a‘);

The value after PROJECT_VERSION defines your current osCommerce version.


How to configure osCommerce to work with SSL?

In order to configure osCommerce to work with SSL you should open the file public_html/catalog/includes/configure.php and make the following changes:

	define(‘HTTP_SERVER’, ‘http://www.yourdomain.com’); // eg, http://localhost – should not be empty for productive servers
define(‘HTTPS_SERVER’, ‘https://yourdomain.com’); // eg, https://localhost – should not be empty for productive servers
define(‘ENABLE_SSL’, true); // secure webserver for checkout procedure
define(‘HTTP_COOKIE_DOMAIN’, ‘www.yourdomain.com’);
define(‘HTTPS_COOKIE_DOMAIN’, ‘yourdomain.com’);
define(‘HTTP_COOKIE_PATH’, ‘/catalog/’);
define(‘HTTPS_COOKIE_PATH’, ‘/catalog/’);
define(‘DIR_WS_HTTP_CATALOG’, ‘/catalog/’);
define(‘DIR_WS_HTTPS_CATALOG’, ‘/catalog/’);

Similar to the above changes have to be made in the file public_html/catalog/admin/includes/configure.php which is responsible for the admin area configuration.

In the above example we are configuring an osCommerce installation in the catalog directory with domain yourdomain.com . You should adjust the above settings to your details.

If you are having problems configuring osCommerce to work with SSL, contact your host for assistance.


OsCommerce Admin Login Problems

If you cannot log into your OsCommerce admin area try the following:

1. Open your OsCommerce database through PhpMyAdmin. If you are not sure which it is check the file includes/configure.php and look for a constant called ‘DB_DATABASE’ .

2. Run the following two queries:

	CREATE TABLE IF NOT EXISTS `administrators` (
  `id` int(11) NOT NULL auto_increment,
  `user_name` varchar(32) NOT NULL,
  `user_password` varchar(40) NOT NULL,
  PRIMARY KEY  (`id`)
) ; INSERT INTO `administrators` (`id`, `user_name`, `user_password`) VALUES
(1, ‘adm’, ’2272bd2219e0bbc353e33f1e774c9d1e:11′);

3. The above will create a new administrator with login ‘adm’ and password ‘pass11′ .

Usually problems with admin login in OsCommerce are caused after an upgrade, contributions installation or security issues. In some cases the above steps might not help you resolve the problem and it is recommended to seek professional assistance.


Why am I getting Fatal error: Unknown function: curl_init()?

This error is a result of cURL not being enabled in PHP. If you are using a Windows server make sure uncomment the cURL extension in the php.ini file which is located in the following directory:
Edit php.ini, look for the following code, and remove the semicolon at the beginning:



The requested URL /account.php was not found on this server.

This issue is most commonly caused by incorrectly configured SSL settings for your OS Commerce. If you don not have private SSL and your OS Commerce is enabled you will receive this error.

Enabling/disabling SSL in osCommerce is quite straightforward. You have to edit /includes/configure.php to disable SSL and the code takes care of the rest. This is an example of SSL enabled configuration:

		// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
define(‘HTTP_SERVER’, ‘http://www.yourdomain.com’); // eg, http://localhost – should not be empty for productive servers
define(‘HTTPS_SERVER’, ‘https://yourdomain.com’); // eg, https://localhost – should not be empty for productive servers
define(‘ENABLE_SSL’, true); // secure webserver for checkout procedure?
define(‘HTTP_COOKIE_DOMAIN’, ‘www.yourdomain.com’);
define(‘HTTPS_COOKIE_DOMAIN’, ‘yourdomain.com’);
define(‘HTTP_COOKIE_PATH’, ‘/catalog/’);
define(‘HTTPS_COOKIE_PATH’, ‘/catalog/’);
define(‘DIR_WS_HTTP_CATALOG’, ‘/catalog/’);
define(‘DIR_WS_HTTPS_CATALOG’, ‘/catalog/’);

In order to disable the SSL you will have to replace

		define(‘ENABLE_SSL’, true);


		define(‘ENABLE_SSL’, false);


Why do my secure pages display a message that states, “This page contains both secure and nonsecure items?”

Secure and non-secure content, or mixed content, means that a webpage is trying to display elements using both secure (HTTPS/SSL) and non-secure (HTTP) web server connections. This often happens with online stores or financial sites that display images, banners, or scripts that are coming from a server that is not secured. The nonsecure link that is causing the problem will have to be found and either removed or edited so that it works with secure pages.


PHP (126)

Will I have to redo my whole site over?

No, in most cases there would be no need to change anything on your site. If you are running a very old version of WordPress you may see better compatibility from upgrading, but then that's good advice no matter what PHP you're using.


Does MySQL work in PHP 5? It seemed to have disappeared.

MySQL is supported with the only change being that MySQL support is no longer enabled by default in PHP 5. This essentially means that PHP doesn't include the –with-mysql option in the configure line so that you must now manually do this when compiling PHP. Windows users will edit php.ini and enable the php_mysql.dll DLL as in PHP 4 no such DLL existed, it was simply built into your Windows PHP binaries.

Also, the MySQL client libraries are no longer bundled with PHP. More details on this topic are covered in the following FAQ and be sure to read the MySQL section for details on installing MySQL. An example configure line would be –with-mysql=/usr while Windows users will need the libmySQL.dll available to the system.


How should I hash my passwords, if the common hash functions are not suitable?

When hashing passwords, the two most important considerations are the computational expense, and the salt. The more computationally expensive the hashing algorithm, the longer it will take to brute force its output.

PHP 5.5 provides a native password hashing API that safely handles both hashing and verifying passwords in a secure manner. There is also » a pure PHP compatibility library available for PHP 5.3.7 and later.

Another option is the crypt() function, which supports several hashing algorithms in PHP 5.3 and later. When using this function, you are guaranteed that the algorithm you select is available, as PHP contains native implementations of each supported algorithm, in case one or more are not supported by your system.

The suggested algorithm to use when hashing passwords is Blowfish, which is also the default used by the password hashing API, as it is significantly more computationally expensive than MD5 or SHA1, while still being scalable.

Note that if you are using crypt() to verify a password, you will need to take care to prevent timing attacks by using a constant time string comparison. Neither PHP's == and === operators nor strcmp() perform constant time string comparisons. As password_verify() will do this for you, you are strongly encouraged to use the native password hashing API whenever possible.


How do I install PHP-GTK on Win32?

Download the latest binaries from gtk.php.net. The zip file contains all binaries needed to run core PHP-GTK, as well as extra features such as Glade/XML and Scintilla. Extract the files to a temporary directory and then copy them into the following locations:

For Windows 98/NT/2000/XP:

In your PHP directory (e.g., c:\php4):

  • php.exe
  • php_win.exe
  • php-cgi.exe
  • php.ini
  • php.ini-gtk
  • all .dll files

In a test directory (e.g., c:\php4\test):

  • all .php files
  • testgtkrc
  • testgtkrc2
  • window.xpm

NOTE: You can install the php.ini into your Windows directory (i.e., c:\winnt or c:\windows) as indicated by the zip file, but it is often not a good option, depending on the installation. It is also no longer required; the php.exe (CLI version as of PHP 4.3.0) will search the working directory, e.g., c:\php4 , as well as the Windows directory. Or you can specify your php.ini location in your command line statement with '-c' option, as given in the php_win example below.

For Windows 95:

PHP-GTK has not been tested on Windows 95 … sorry.

Testing the installation

When the PHP-GTK files are installed, you can verify your setup using a DOS command line. A typical example would be: c:\php4\php c:\php4\test\hello.php

To avoid the DOS box, you can use the php_win executable, provided in the install file:

c:\php4\php_win c:\php4\test\hello.php


start c:\php4\php_win c:\php4\test\hello.php


c:\php4\php_win -c \php4\php.ini -f c:\php4\test\hello.php

If you have installed your php.ini file in your Windows directory, the -c option can be dropped. For more information on command line options, see 'Using PHP from the command line' on the main PHP site.


If you can't produce the hello window, try the following:

  • Verify the hello.php location, i.e., [drive:]\php4\test
  • Open hello.php in Notepad, and make sure there is no obvious corruption in the code.
  • Modify your php.ini file, to log any errors, as detailed below.
  • If you still have a problem, subscribe to the PHP-GTK general discussion list and post your question there.


  • To debug your scripts, modify the php.ini file as follows:

    • Find the line for 'log_errors' . Set it to 'On'.
    • Find the line for 'error_log' . Remove the beginning semicolon (uncomment) and replace 'filename' with an actual file location
      Example: error_log=c:\php4\error_log.txt .
    • If the error file does not exist, php will create it on the next run. Open the file and review.
  • If you are planning to launch on an association, decide which extension you want to use for your scripts. Be aware that other applications register .php, so something like .php-gtk might be a better option.
  • You can set your scripts to use Win32 themes, courtesy of Christian Weiske. Check out the info page at:
  • Install the php-gtk launcher. It handles many of the Windows directory issues and provides a series of PHP-GTK icons. Also from Christian.
  • Consider using Glade/XML for setting up your screens and reducing maintenance time.
    Start with the info page at: http://gtk.php.net/manual1/en/glade.gladexml.php.


Is it possible manipulate visual objects in PHP ?

Generally it is, but as PHP is mostly used as a web scripting language it runs in the web servers context, thus visual objects will never appear on the servers desktop. If you use PHP for application scripting e.g. in conjunction with PHP-GTK there is no limitation in accessing and manipulating visual objects through COM.


Difference between Reply-to and Return-path in the headers of a mail function.

Reply-to is the address where the email needs to be delivered.
Return-path – specifies the address In case of a failed delivery
$headers .= "Reply-To: info@info.com\r\n";
$headers .= "Return-Path: info@info.com\r\n";


I think I found a bug! Who should I tell?

You should go to the PHP Bug Database and make sure the bug isn't a known bug. If you don't see it in the database, use the reporting form to report the bug. It is important to use the bug database instead of just sending an email to one of the mailing lists because the bug will have a tracking number assigned and it will then be possible for you to go back later and check on the status of the bug. The bug database can be found at » http://bugs.php.net/.


Can I store a COM object in a session ?

No, you can't. COM instances are treated as resources and therefore they are only available in a single script's context.


Where is my document root?

The location of your default Zend Server document root depends on the operating system and the Web server you are using:

For Windows

If Zend Server is running on Microsoft IIS – C:/inetpub/wwwroot

If Zend Server is running on Apache – C:/Program Files/Zend/Apache2.2/htdocs

If you changed the location of your Zend Server installation, your document root will be located at <Zend_Server_installation_directory>/Apache2.2/htdocs , where <Zend_Server_installation_directory&gt ; is the location of the directory in which your Zend Server is installed.

For Linux

the location of your document root is defined by your distribution's Apache packages, and will vary depending on your distribution and configuration.

Common locations include:

  • Debian, Ubuntu – /var/www
  • Fedora Core, RHEL, CentOS, Oracle Enterprise Linux – /var/www/html
For Mac OS X



How do I deal with register_globals?

For information about the security implications of register_globals, read the security chapter on Using register_globals.

It's preferred to use superglobals, rather than relying upon register_globals being on.

If you are on a shared host with register_globals turned off and need to use some legacy applications, which require this option to be turned on, or you are on some hosting server, where this feature is turned on, but you would like to eliminate security risks, you might need to emulate the opposite setting with PHP. It is always a good idea to first ask if it would be possible to change the option somehow in PHP's configuration, but if it is not possible, then you can use these compatibility snippets.

Example Emulating Register Globals

This will emulate register_globals On. If you altered your variables_order directive, consider changing the $superglobals accordingly.

// Emulate register_globals on
if (!ini_get('register_globals')) {
    $superglobals = array($_SERVER, $_ENV,
        <$_FILES, $_COOKIE, $_POST, $_GET);
    if (isset($_SESSION)) {
        array_unshift($superglobals, $_SESSION);
    foreach ($superglobals as $superglobal) {
        extract($superglobal, EXTR_SKIP);

This will emulate register_globals Off. Keep in mind, that this code should be called at the very beginning of your script, or after session_start() if you use it to start your session.

// Emulate register_globals off
function unregister_GLOBALS()
    if (!ini_get('register_globals')) {

    // Might want to change this perhaps to a nicer error
    if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
        die('GLOBALS overwrite attempt detected');

    // Variables that shouldn't be unset
    $noUnset = array('GLOBALS',  '_GET',
                     '_POST',    '_COOKIE',
                     '_REQUEST', '_SERVER',
                     '_ENV',     '_FILES');

    $input = array_merge($_GET,    $_POST,
                         $_COOKIE, $_SERVER,
                         $_ENV,    $_FILES,
                         isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
    foreach ($input as $k => $v) {
        if (!in_array($k, $noUnset) && isset($GLOBALS[$k])) {


For information about the security implications of register_globals, read the security chapter on Using register_globals.

It's preferred to use superglobals, rather than relying upon register_globals being on.

If you are on a shared host with register_globals turned off and need to use some legacy applications, which require this option to be turned on, or you are on some hosting server, where this feature is turned on, but you would like to eliminate security risks, you might need to emulate the opposite setting with PHP. It is always a good idea to first ask if it would be possible to change the option somehow in PHP's configuration, but if it is not possible, then you can use these compatibility snippets.

Example Emulating Register Globals

This will emulate register_globals On. If you altered your variables_order directive, consider changing the $superglobals accordingly.

// Emulate register_globals on
if (!ini_get('register_globals')) {
    $superglobals = array($_SERVER, $_ENV,
        <$_FILES, $_COOKIE, $_POST, $_GET);
    if (isset($_SESSION)) {
        array_unshift($superglobals, $_SESSION);
    foreach ($superglobals as $superglobal) {
        extract($superglobal, EXTR_SKIP);

This will emulate register_globals Off. Keep in mind, that this code should be called at the very beginning of your script, or after session_start() if you use it to start your session.

// Emulate register_globals off
function unregister_GLOBALS()
    if (!ini_get('register_globals')) {

    // Might want to change this perhaps to a nicer error
    if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
        die('GLOBALS overwrite attempt detected');

    // Variables that shouldn't be unset
    $noUnset = array('GLOBALS',  '_GET',
                     '_POST',    '_COOKIE',
                     '_REQUEST', '_SERVER',
                     '_ENV',     '_FILES');

    $input = array_merge($_GET,    $_POST,
                         $_COOKIE, $_SERVER,
                         $_ENV,    $_FILES,
                         isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
    foreach ($input as $k => $v) {
        if (!in_array($k, $noUnset) && isset($GLOBALS[$k])) {



PhpMyAdmin (120)

How can I restore (upload) my database or table using a dump? How can I run a ”.sql” file?

Click on a database name in the navigation panel, the properties will be displayed. Select “Import” from the list of tabs in the right–hand frame (or “SQL” if your phpMyAdmin version is previous to 2.7.0). In the “Location of the text file” section, type in the path to your dump filename, or use the Browse button. Then click Go. With version 2.7.0, the import engine has been re–written, if possible it is suggested that you upgrade to take advantage of the new features. For additional help on this subject, look for the word “upload” in this document.


Extended-ASCII characters like German umlauts are displayed wrong.

Please ensure that you have set your browser’s character set to the one of the language file you have selected on phpMyAdmin’s start page. Alternatively, you can try the auto detection mode that is supported by the recent versions of the most browsers.


When I view a database and ask to see its privileges, I get an error about an unknown column.

The MySQL server’s privilege tables are not up to date, you need to run the mysql_upgrade command on the server.


The number of rows for InnoDB tables is not correct.

phpMyAdmin uses a quick method to get the row count, and this method only returns an approximate count in the case of InnoDB tables. See $cfg['MaxExactCount'] for a way to modify those results, but this could have a serious impact on performance. However, one can easily replace the approximate row count with exact count by simply clicking on the approximate count. This can also be done for all tables at once by clicking on the rows sum displayed at the bottom.


How do I create a relation in designer?

To select relation, click: The display column is shown in pink. To set/unset a column as the display column, click the “Choose column to display” icon, then click on the appropriate column name.


The error message “Warning: MySQL Connection Failed: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (111) …” is displayed. What can I do?

If you use Apache web server, phpMyAdmin exports information about authentication to the Apache environment and it can be used in Apache logs. Currently there are two variables available:

User name of currently active user (he does not have to be logged in).
Status of currently active user, one of ok (user is logged in), mysql-denied (MySQL denied user login), allow-denied (user denied by allow/deny rules), root-denied (root is denied in configuration), empty-denied(empty password is denied).

LogFormat directive for Apache can look like following:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n"   pma_combined

You can then use any log analyzing tools to detect possible break-in attempts.

For RedHat users, Harald Legner suggests this on the mailing list:

On my RedHat-Box the socket of MySQL is I get “Missing parameters” errors, what can I do? /var/lib/mysql/mysql.sock. In your I get “Missing parameters” errors, what can I do? php.ini you will find a line

I get “Missing parameters” errors, what can I do?  mysql.default_socket = I get “Missing parameters” errors, what can I do?  /tmp/mysql.sock

change it to

I get “Missing parameters” errors, what can I do?  mysql.default_socket = I get “Missing parameters” errors, what can I do?  /var/lib/mysql/mysql.sock

Then restart apache and it will work.

Here is a fix suggested by Brad Ummer:

  • First, you need to determine what socket is being used by MySQL. To do this, telnet to your server and go to the MySQL bin directory. In this directory there should be a file named mysqladmin. Type ./mysqladmin variables, and this should give you a bunch of info about your MySQL server, including the socket ( /tmp/mysql.sock, for example).
  • Then, you need to tell PHP to use this socket. To do this in phpMyAdmin, you need to complete the socket information in the I get “Missing parameters” errors, what can I do?config.inc.php. For example: I get “Missing parameters” errors, what can I do?$cfg['Servers'][$i]['socket'] Please also make sure that the permissions of this file allow to be readable by your webserver (i.e. ‘0755’).


I get JavaScript errors in my browser.

Issues have been reported with some combinations of browser extensions. To troubleshoot, disable all extensions then clear your browser cache to see if the problem goes away.


I get an out of memory error, and my controls are non-functional, when trying to create a table with more than 14 columns.

We could reproduce this problem only under Win98/98SE. Testing under WinNT4 or Win2K, we could easily create more than 60 columns. A workaround is to create a smaller number of columns, then come back to your table properties and add the other columns.


I am running Apache with mod_gzip- on Windows XP, and I get problems, such as undefined variables when I run a SQL query.

A tip from Jose Fandos: put a comment on the following two lines in httpd.conf, like this:

# mod_gzip_item_include file \.php$
# mod_gzip_item_include mime "application/x-httpd-php.*"

as this version of mod_gzip on Apache (Windows) has problems handling PHP scripts. Of course you have to restart Apache.


What format strings can I use?

In all places where phpMyAdmin accepts format strings, you can use @VARIABLE@ expansion and strftime format strings. The expanded variables depend on a context (for example, if you haven’t chosen a table, you can not get the table name), but the following variables can be used:

HTTP host that runs phpMyAdmin
MySQL server name
Verbose MySQL server name as defined in $cfg['Servers'][$i]['verbose']
Verbose MySQL server name if set, otherwise normal
Currently opened database
Currently opened table
Columns of the currently opened table
phpMyAdmin with version


Prestashop (10)

Problem­ of­ memory­ allocation­ with­ 1and1.

Due to resource limits on our Shared Hosting machines, it is not possible to allocate more memory to PHP than the maximum for your package. Using a php.ini file or the memory_limit directive to increase memory for PHP may result in the phpinfo() output reflecting the change however the server will not allocate more memory than the limit imposed by 1&1.

Older packages were limited to a maximum of 30MB for PHP memory regardless of package. Starting with the Dual Hosting packages, the limits have increased. You can view the PHP Memory Limit for each Dual Hosting package on our order site.


Process ­to­ follow­ to­ update­ prestashop?

The steps of the upgrade process are:

  1. Save and Backup Your Current Store:

    • Deactivate your store ("Maintenance" page of the "Preferences" menu).
    • Back up your files to your desktop, using your FTP client in a new "prestashop-prod" folder. This will be a complete copy of your production site.
    • Back up your database ("Advanced Parameters/DB Backup" page, or using phpMyAdmin).
    • Back up your customized translation ("Export a language" section in "Tools/Translations" tab).
  2. Getting ready for the new version:
    • Download and unzip the latest version of PrestaShop: http://www.prestashop.com/en/download, and unpack it in a new "prestashop-prep" folder.
    • Copy your personal files (images, logos, photos, translations, modules, etc.) from "prestashop-prod" to "prestashop-prep" on your computer. A detailed list is available further down in this guide.
    • Copy the "prestashop-prep" folder to the web folder on your local server (/htdocs/www, or any other name used by the server package you chose). This is the folder where you will first try to upgrade your PrestaShop, keeping your original backed-up files (prestashop-prod) and the files you prepared (prestashop-prep).
    • Recreate the production database on your local server: using phpMyAdmin, create a local database in which you will put the data from your production shop, using the SQL files that were backed-up at the start of the process.
  3. Starting the Local Update:
    • Launch the update script on your local server by accessing it with your browser. In version 1.5, that script is located at/install/upgrade/upgrade.php.
    • Verification of all parameters before the update: follow the instructions on screen and make sure your server conforms to the new version technical requirements.
    • Finishing the update: once the updater has finished, delete the /install folder and access both your front and back-office to make sure it works.
  4. QA and Testing:
    • Import your translations ("Import a language pack manually" section in "Localization/Translations" page).
    • Check that your theme is still working as expected. If this is not the case, you will have to edit its files.
    • Test your shop thoroughly: create accounts, buy products, cancel orders, check the invoices, etc.
  5. Start the update on your production web server:
    • Using your FTP client, replace the files for your online shop with those from your "prestashop-prep" folder.
    • Launch the update script on your production server by accessing it with your browser. In version 1.5, that script is located at/install/upgrade/upgrade.php.
    • Verification of all parameters before the update: follow the instructions on screen and make sure your server conforms to the new version technical requirements.
    • Finishing the update: once the updater has finished, delete the /install folder and access both your front and back-office to make sure it works.
    • Import your translations ("Import a language pack manually" section in "Localization/Translations" page).
    • Check that the main domain name is correct ("Preferences / SEO & URLs" page, "Shop URL" section).
    • Regenerate your robots.txt files ("Preferences / SEO & URLs" page, "Generate robots.txt" section).
    • Check that your theme still works as expected. If not, you will have to edit its files.
    • Test your store thoroughly: create accounts, buy products, cancel orders, check invoices, etc.
  6. Going live with your up-to-date store
    • Activate your store ("Maintenance" page under the "Preferences" menu).


How to install a PrestaShop theme on my ecommerce website?

The installation of PrestaShop themes is simple and can be completed in a matter of clicks. 

From your Addons account click on “Order” page, download the zip file of the theme that you just purchased. Choose the file that fits the version of PrestaShop you are using.

If you use PrestaShop version 1.6:

1. From your PrestaShop back office, click on the “Modules” tab.

2. In the sign in window, enter your Addons ID and password then click on “Connect.”

If you are using PrestaShop version 1.4 or 1.5:

1. From your PrestaShop back office, click on the “Modules” tab.

2. Search for the Import/export a theme module and install it. The configuration of this module will help you install the theme you just purchased.

PrestaShop Addons does not provide support on Community developed themes. We ask that you contact the seller directly for any type of support regarding the theme(s).


Generate­ the­ htaccess­ with­ prestashop.

1·Create an empty file on your desktop with a simple text-editor, such as Windows’s Notepad (not Word!) or OS X’s TextEdit.

2·Save the file as htaccess.txt, in a folder where you can easily find it. If possible, save it as an purely ASCII or ANSI file.

3·Upload it to your server using an FTP client, such as FileZilla. Put the file at the root of your shop’s directory.

4·Change its permissions to read and write everyone (CHMOD 666 in Unix), with your FTP client for instance.

5·Go to the PrestaShop back-office, and under the Preferences tab and “SEO & URLs” sub-tab, enable “Friendly URL” (bottom of the page).

6·Go to the “Tools” tab, then the “Generators” sub-tab, and click the “Generate the .htaccess file” button.


Prestashop Quick Access – fix “Invalid security token”

PrestaShop admin panel has quick menu to your favorites pages, at the right-top of every page of the PrestaShop back-office. The “Quick Access” menu administration page enables you to create customized shortcuts, and make your navigation within the administration area much more comfortable and faster. You can open page in a new web browser tab or in new window.

How Adding a new link

Please got to Prestashop admin panel: Administration > Quick Access, click on “Add new”.
Name – enter shortcut unique name
URL – page address:

Copy page address from the browser’s address bar. Example:
You need remove token and Prestashop admin panel base directory, so final result looks like this:  index.php?controller=AdminCustomers

But is one problem when you want a short reference to the module.
If you’ve done as required by Prestashop, you get token security error:

Invalid security token
I understand the risks and I really want to display this page
Take me out of here!

Module address:


This url we need refactoring to link like this:
index.php?controller= AdminModules &configure=bankwire

With controller=AdminModules small fix you avoid this annoying “Invalid security token” page.


How to configure Prestashop to work with another domain

Prestashop, like many other applications out there, works based on a domain name. In case you wish to use your Prestashop application with a different domain you should change the PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL options in your Prestashop’s database. To edit these options you can use the phpMyAdmin tool available in cPanel.

Log into cPanel and access phpMyAdmin, after which select your Prestashop database and browse the table ps_configuration where the PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL records are located. Change their value to match your new domain name.

You should also make sure that your Prestashop’s base directory is correctly set in the application’s configuration file – settings.inc.php . You can find the configuration file in the config folder, located in the root of your Prestashop installation. You can edit the configuration file via FTP or by using cPanel’s File Manager tool.

Once you have opened the file for editing look for the line:

define(‘__PS_BASE_URI__’, ‘/‘);

In case your Prestashop installation is located in the web root folder of your domain name, this line should remain as above. If the installation is located into a sub folder, the line should be changed to reflect its location:

define(‘__PS_BASE_URI__’, ‘/subfolder/‘);

Where “subfolder” is the actual name of the folder where Prestashop has been installed.


How to install a PrestaShop module on my online store?

The installation of PrestaShop modules can be completed in just a few clicks!

From your Addons account click on the “Order” page then download the module’s zip file that you just purchased. Be sure to choose the file that fits your running version of PrestaShop. 

If you are using PrestaShop version 1.6:

1. From your PrestaShop back office, click on the “Modules” tab.

2. In the sign in window, enter your Addons ID and password then click on “Connect”. Once this step is completed, every purchase you make on PrestaShop Addons will automatically appear in your back office modules.

If you are using PrestaShop version 1.4 or 1.5:

1. From your PrestaShop back office, click on the “Modules” tab.

2. On the top right you’ll find “Add a New Module”, click on it and download the module file that you previously purchased and saved.

3. Finally, click “Install” to begin configuring it.

PrestaShop Addons does not provide support on Community developed modules. We ask that you contact the seller directly for any type of support regarding the module(s).

For further information, please read the official documentation.


How To Fix Prestashop 1.5. * Ajax Cart Bug In Internet Explorer

In the first versions of Prestashop 1.5.* there is a bug which is reproduced in old versions for all browsers as well as in all Internet Explorer versions. This bug does not allow to save cookies when adding a product to the cart if the Block Cart module is enabled, thus your shopping cart remains empty. To fix this you need to modify the js-file /modules/blockcart/ajax-cart.js:

Comment out the following condition in the method аjаxCаrt.add(): //if($('#cart_block #cart_block_list').hasClass('collapsed'))


Place an аjаx-request in the method аjаxCаrt.expand() before slideUp is invoked.

Then set the same аjаx request for a synchronous execution, i.e.set the async option as false, instead of true.

After that clear your browser cookies.


How to import product features by csv import­?

(Importing for PS 1.3x go here)
Import Products – You are here
Prestashop version : 1.4.x
Before posting questions/issues with importing make sure you use the latest Prestashop version!

Google Docs
With google docs you can create nice 'excel' like sheets that are also UTF-8. If you have an gmail account you can use Google Docs. I have included some sample files below for you to use.
Some important notes:
* Date fields have a fixed format that is not compatible with the date field in Prestashop
Google uses this : 2010/03/26
Presta uses this : 2010-03-26
If you want to use the prestashop format, be sure to use a ' in front of the date. Otherwise google docs will convert the date to its own format
* Multiple Field Seperator is , and cannot be changed
HTML or multiple lines in your Product Description field
Finally html support is available in These codes will work:
New fields in 1.4.4
This version adds 3 new fields compared to 1.4.3. These fields are :

  1. Available for order – Checkbox in BO. Needs to be set to 1, otherwise order button is disabled
  2. Date Add Product – Still vague
  3. Show Price – Checkbox in BO. Needs to be 1, otherwise order button is disabled.


How to clear the cache in Prestashop

When making changes in Prestashop they will often not appear right away due to old cached information. The solution is to clear the cache of the application.

Prestashop version 1.4 and above caches data using Smarty. Cached data is stored in the following folders:





all of which are located in your Prestashop’s installation folder. For example, if your Prestashop store has been installed in the public_html folder of your hosting account, cached information can be found in:





To clear Prestashop’s cached data, delete the content of these folders and reload your website in your browser to take a look at the changes you have made.

You can also disable or manage how Prestashop caches information from the application ’s back office -> Preferences -> Performance.


Responsive Website Design (22)

There are too many technical terms. What is a responsive website in laymen terms?

Explained very simply, a responsive website is one that adapts to the screen size of the device where the website is being served. So when the page resizes, the layout adjusts according to the fit of the screen.


What about ads on a responsive website?

Until responsive website ads become the norm, it’s a good idea to choose standard ad sizes, such as 300×250 which can fit easily on any screen size.


Why do I need to have a responsive website?

Besides desktops, web browsing on tablets and mobile phones is on the rise, helped by their greater capabilities and lower prices. Therefore, if you don’t have a responsive, mobile-friendly website in the technically advanced environment today, you risk losing valuable traffic.


How long will it take to launch my responsive website after the initial meeting?

While time frames vary depending on the scope of the project, on average it takes about 3-4 weeks to create a responsive website.


Can I convert my existing website into a responsive one?

Of course. Here, at http://flauntresponsive.com/, we’re there to not only create a responsive website from scratch, but also convert existing ones to become mobile-friendly.


What are some important considerations to keep in mind when getting a responsive website designed?

Important factors to consider before getting your responsive website designed are money, the particular time frame for completion you have in mind and the content to be included.


Is there a way of checking whether a website is responsive or not?

Yes! Just open the website in your desktop browser window, and resize the window. If the layout of the website changes, you’ve got a responsive website. Resize this website to see!


What is Query used for?

The Semantic Web is a Web of data — of dates and titles and part numbers and chemical properties and any other data one might conceive of. RDF provides the foundation for publishing and linking your data. Various technologies allow you to embed data in documents (RDFa, GRDDL) or expose what you have in SQL databases, or make it available as RDF files.

However, just as relational databases or XML need specific query languages (SQL and XQuery, respectively), the Web of Data, typically represented using RDF as a data format, needs its own, RDF-specific query language and facilities. This is provided by the SPARQLquery language and the accompanying protocols. SPARQL makes it possible to send queries and receive results, e.g., through HTTP or SOAP.

Technically, SPARQL queries are based on (triple) patterns. RDF can be seen as a set of relationships among resources (i.e., RDF triples); SPARQL queries provide one or more patterns against such relationships. These triple patterns are similar to RDF triples, except that one or more of the constituent resource references are variables. A SPARQL engine would returns the resources for all triples that match these patterns.

Using SPARQL consumers of the Web of Data can extract possibly complex information (i.e., existing resource references and their relationships) which are returned, for example, in a table format. This table can be incorporated into another Web page; using this approach SPARQL provides a powerful tool to build, for example, complex mash-up sites or search engines that include data stemming from the Semantic Web.


What will be the cost?

Again, the cost is a function of how extensive your particular project is. We can assure you, however, of the most reasonable rates for the quality you’ll get. Contact us to discuss your individual project and the costs involved.


What are CSS media queries?

A CSS media query sets limits on the scope of the style sheet for features such as line height, font size, etc.


SEO (7)

AdSense Banned My Sites, What to Do?

A reinstating procedure is more like proving the AdSense team that it wasn’t you who made the fraud and you have nothing to do with any type of terms and policies breaking actions.

  1. Always write your e-mails in a perfect grammar.
  2. Write the letters addressing yourself to a 3rd person, without taking the manner personally.
  3. Be corporate, be understanding and nice.
  4. Try to offer every little bit of help possible, so that the AdSense team can check all the possible variables.
  5. If you are a fairly known figure, for it’s whitehat techniques or just for it’s truly honest behavior.
  6. Try not to spam the AdSense team with repeated e-mails sent to multiple e-mail addresses, telling them the exact same thing. If you sent it once (maximum twice) that’s all you can do. ALL the e-mails are read.
  7. Do not reply to the first horrifying e-mail telling you your AdSense account has been disabled.

    Why not reply ? Because the first Google AdSense Account Disabled e-mail comes from the e-mail address adsense-adclicks@google.com (which is NOT ticket based) , and because the e-mails that come to you after you use the appeal form, come from adsense-adclicks-appeal@google.com (which IS ticket based).

    Use the AdSense invalid clicks appeal form. After you will get your first reply from the message sent to the appeal form, from a Google representative (they have a ticket system), you can then reply to that.

  8. Try to offer them server logs, tracking and analytics logs, and any other useful information, that they can use to determine if your account got click-bombed or not.
  9. Whenever you write e-mails, please try to sign your full name, telephone, mobile telephone, e-mail address, website, and so on, in the e-mail (please see the template below).
  10. In the AdSense appeal form, at the e-mail part (Email Address:), always write your AdSense publisher e-mail, and not another e-mail.
  11. One again, write in a polite manner, always. Polite + corporate + helpful + not spamming = success.


What is SEO?

Search Engine Optimization, or SEO, is the process of increasing website visibility via a search engine’s natural or organic results. The more frequently a site appears in a search results list, the more visitors that frequent the webpage. SEO targets various search genres, such as news, industry-specific, and image searches.


What is SERP?

A shortened form of Search Engine Results Page, SERP is a webpage that is returned when a search engine comprises a list of matching search results from a specific term or question. This page includes website html, titles, and a brief description of the matching content.


What is PageRank?

Pagerank is a commonly understood concept of a page’s rank based on others that serve a similar purpose or contain linear content. Web pages with the highest relevance are displayed at the top of a search engine list. Undoubtedly, these positions are highly sought-after. Once reached, they are also challenging to maintain, as well.


What is a Keyword?

A commonly known term, keyword is a word within a specific webpage that dictates the nature of the content. Multiple keywords provide a summary or semantic meaning for search engine pages. In fact, keyword phrases may even influence whether a user desires to view the content portrayed on a web page by search engine descriptions. Without a doubt, keywords are perhaps the most important inclusion in web pages and SEO.


What is a Backlink?

Search engines rank websites based on the number of backlinks it utilizes. Simply speaking, a backlink is a link from one website to another. These links increase visibility to audiences researching specific topics, because they lead users to other websites that feature desired information and content in a linear manner.


What is a Title Tag?

One of the most important factors for search engine optimization, title tags include specific keywords, names, and phrases that are unique to individual web pages. Though often overlooked, title tags appear in the clickable link on search engine result pages.


Sugar CRM (41)

Why can’t I delete a user?

To preserve data associated with a user, there is no option to delete a user. However, you may change a user's status to Inactive, which prevents them from logging in. To change a user's status to Inactive, follow these steps:

1) Login as an administrator
2) Click the Admin link in the top-right corner
3) Click User Management
4) Click the username you'd like to set as Inactive
5) Select Inactive from the Status dropdown
6) Press Save to confirm your changes


How do I change the default theme?

To change the default theme, follow these steps. In this example, we will be changing the default theme to Retro:

1) Open your config.php file, located in the main Sugar directory
2) Locate this line:
      'default_theme' => 'Sugar',
3) Change the line to:
      'default_theme' => 'Retro',
4) Save the file

Note: This setting will affect all users.


What modules do you support with your solution?

With the latest version, you can leverage targets from Accounts, Leads, Contacts, Targets and Prospects.


What URL is needed for the Outlook Plug-in?

The server URL to use will be similar to the URL that you use to login to the Sugar application. However, you will replace the index.php filename at the end of the URL and replace it with soap.php. For example, change http://host.domain.com/sugarcrm/index.php to http://host.domain.com/sugarcrm/soap.php .


“Maximum execution time” error when populating demo data

In the file SUGAR_HOME\install\populateSeedData.php, there are lines that read:

Set the max time to one minute. ini_set("max_execution_time", "60");

Modify the value of 60 to a larger amount. The value is in seconds, so a new value of 300 equates to 5 minutes, 600 equates to 10 minutes, and 3600 equates to 60 minutes.


How secure is Sugar?

Sugar is only as secure as your users make it. We do everything we possibly can to ensure the security of your data, but ultimately security comes down to passwords. Sharing passwords, or using simple words as passwords is asking for trouble. Ideally, you should use a strong password consisting of a minimum of 8 characters, including upper and lowercase letters, plus numbers.


Why did SugarCRM change from the SPL to GPL v3?

SugarCRM believes the GPL v3 will become the standard for all open source licenses, and wanted to get a head start on adopting that standard.


How do I get my installed language packs to show up in the login options?

To make the language packs that you have installed available to your users, modify your SUGAR/config.php file:

array (
'en_us' => 'US English',
'fr_fr' => 'French',
'ge_ge' => 'German',
'es_es' => 'Spanish',

If you prefer, you can re-order the list as appropriate, or rename French to Francais, etc.


Are language packs subject to GPL v3 provisions? Themes? Modules?

The GPL v3 FAQ contains this item and this item that discusses the notion of a larger work and what constitutes a larger work. Our interpretation of GPL v3 is that language packs and, more generally, any code (e.g., modules, themes) that interfaces directly with (and would not work without) Sugar Community Edition form a larger work and are thus subject to GPL v3.

This is contrasted with extensions that interface with Sugar Community Edition via web services APIs (i.e., SOAP APIs). These extensions run independently of Sugar Community Edition and can presumably work in the absence of Sugar Community Edition, do not form a larger work, and can therefore be licensed under a non-GPL license.


What are the advantages of the GPL v3?

Since GPL v3 is based on the most popular license in the open source universe, the community is able to adopt and develop on what is sure to be the de facto standard license. This will insure greater interoperability and enhanced community collaboration as GPL v3 becomes widely adopted in the same manner as earlier versions of the GPL.


Vtiger (1)

What­ is ­vtiger ­crm­ licensing­ policy?

Vtiger CRM software is built over the following open source software:

  • Apache web server software, under the Apache License

  • MySQL database software, used under the GPL

  • PHP software, under the PHP License, version 3.0

  • SugarCRM software used under the SugarCRM Public License (SPL 1.1.2) (SPL – a copy of Version 1.1.2 is found here)

  • gdwin32 (graphic library) from http://www.boutell.com/gd/

  • PHPMailer software used under the LGPL

  • ADOdb software used under the BSD

  • phpSysinfo software used the GPL

  • Vtiger's modifications to the SugarCRM code are under vtiger Public License 1.1 based on Mozilla Public License (MPL). Additional components written by vtiger, not coming under the purview of the SPL, are provided under MPL.


Web Design and Applications (87)

What does the inBOX25 integration provide me for SugarCRM and why would I want to use it?

inBOX25 is a Commercial Email Service Provider (ESP) and core competency is high-volume, permission based email marketing.  At our core, our solution enables organizations to properly create, deliver and track high impact email marketing campaigns.  Even though SugarCRM offers 'email campaigns' as a feature in their native application, it still lacks many of the fundamentals required to properly deploy commercial email.  For example, SugarCRM users are required to provide their own outbound mail service (SMTP) in order to send email campaigns through SugarCRM.  This is inherently problematic because most users will either utilize their corporate email server and risk disrupting their internal email services, should they become blacklisted.  Or, they'll rely on their Internet Service Provider (ISP) as their SMTP provider, in which case they will encounter the same blacklist risk and also a risk of being disconnected as most ISP's forbid sending commercial email through their service.  Not to mention, neither of these solutions are appropriately configured for deploying bulk commercial email.  In both instances, delivery will be very poor and spam filters will become very problematic.  inBOX25 eliminates these delivery hurdles, because our solution gives SugarCRM users access to our state-of-the-art network and delivery service.  Our solution easily bolts onto the native SugarCRM campaign module, to give you the best of both worlds.


What are Vertical Applications used for?

Apart from the inherent advantages for a particular vertical application area to get a better familiarity with a particular W3C technology, these groups also provide valuable feedbacks on the technologies themselves. Vertical applications may bring forward specific and sometimes highly non-trivial use cases, requirements in terms of, say, the expressivity of vocabulary or query languages, efficiency considerations for inferences, etc. Work on the second generations of languages like OWL2 or SPARQL1.1, or the work on R2RML, has been greatly motivated by the feedbacks provided by these vertical applications.


Testing web applications in Internet Explorer

Many developers use Internet Explorer to test their web pages before they upload to the web server. But this can result in an information bar that reads indicates that some of the content on this page may be blocked for security purposes. To get the script to load, you might have to click a link to “Allow blocked content.”

Internet Explorer version 6 service pack 2 introduced a security feature where it blocks JavaScript and CSS (in essence any external documents) from running on web pages that are opened from a local machine rather than from the Internet. This is a security feature to keep malicious software from gaining access to your computer. This feature is included in all versions of IE after 6 SP2.

Normally, JavaScript does not have access to things like the computer file system that the browser is running in. But when a file is opened locally, the browser can consider the local file system to be the same as a web server. And “active content” such as JavaScript could get access to that local file system and cause problems.

This is an important security feature for non-web developers because it prevents hackers from sending web pages to users that are intended to be opened locally and thus gain access to the computer.

Most Web Developers Need to Test Locally

However, if you're like most web developers and designers, you need to be able to test your pages locally before uploading to a server, and getting a JavaScript error every time can be frustrating.

First, you need to verify that Internet Explorer is not blocking scripting, ActiveX, and Java.

  1. In Internet Explorer, in the “Tools” menu, go to “Internet Options”
  2. In the “Internet Options” box, click on the “Security” tab
  3. Change your settings to the “Default” level and click “OK”

If that doesn't work, you can go into the IE preferences and completely disable this security setting:

  1. In Internet Explorer, in the “Tools” menu, go to “Internet Options”
  2. Go to the “Advanced” tab and scroll down to the “Security” section
  3. Check the box next to “Allow active content to run files on My Computer” and click “OK”

If you still can't get your script to run, you should upload it to a web server, such as a testing server, and try it there. If the script continues to get errors, then it may be that you have an error in your JavaScript that is affecting the page load.


How to test Mobile Web Pages and Applications

When you are building web pages and applications for mobile devices, one of the most important steps you can take is testing. Testing gives you a good idea of what your readers are going to experience when they come to your site, and by fixing the major problems ahead of time, you can avoid issues with your customers later.

Testing a page or application for mobile uses the same checklist as testing for a full-sized browser. You need to check that the page looks good before you post it, and then check it after it’s live. But one step that many designers ignore is testing on mobile devices. Even if you don’t have a separate page for mobile users, you should test your pages on mobile devices—especially tablets. Tablet devices are growing in popularity every year and it’s becoming more and more likely that some of your visitors will be on tablets. Touch screen tablets have some different design requirements, even if you expect them to use your standard full-sized site.

The more devices you can test your website on, the better, but your priorities should be:

  • iPad
  • iPhone and iPod touch
  • Android tablets
  • Android phones
  • other smartphones
  • standard cellphones

Most people browsing the web on older cellphones and less-capable smartphones will be fairly tolerant of design problems. But as the devices get more sophisticated, so will the expectations of your readers.

How to Test


There are a few steps you should follow for all your web pages to test effectively for both mobile and desktop browsers.

Options for Testing on Mobile Devices


Test on the Real Devices

The best way to test a website on a mobile device is to load it on a mobile device. In general, this means posting the page or site to a live web server and then browsing to the page on the devices to test them.

Most people, of course, don’t have access to multiple mobile devices, but there are some options:

Use an Emulator

If there is no way for you to get a real device to test on, you can use an emulator. Emulators don’t give you as good information because they can be slower than the real device, and they don’t show all the features of the devices. For instance, you access emulators with your mouse, not with a finger like on a touch screen.

There are computer desktop emulators for Android and iPhone/iPad that you can use to test your designs in.

There are also online emulators that include support for testing on mobile devices:

Online emulators can be even more limited than desktop emulators. Many of them only support taking screen shots on the devices and can’t show you how the interactive elements work (or don’t work) on the devices.

Emulators are not ideal for testing on mobile, but if they are the only option you have, they are better than not testing at all.

  • First you should validate your HTML to make sure that there are no egregious errors. The HTML doesn’t have to be 100% valid, but knowing what errors there are can help you eliminate them as the cause of any problems you discover later.
  • Then you should test your site on all the browsers you have on your computer. I recommend downloading and installing Firefox, Chrome, Safari, and Opera if you don’t already have them installed. These are available for Windows and Macintosh.
  • If you have another computer with a different operating system (such as Mac OS or Linux) you should test your site on that computer’s browsers as well. A site might look fine on Windows Internet Explorer and then completely break on Macintosh Safari.
  • Once you’re confident that the site looks okay on desktop computers, you should change the window size of one of the browsers to a smaller size. If you’re using CSS3 media queries, this may even make the design look different. You can use a plugin like Web Developer Tools to resize your browser window to different pre-set sizes to see how it might look on smaller mobile screens.
  • If you don’t have access to a different machine, you should test in an online tool like BrowserCam.
  • Then test on as many mobile devices as you can. The more different devices you test on, the better your website or application will work for your customers.

    • Buy the devices
    • Rent the devices
    • Borrow one from a friend or relative or ask them to test it and send you a screen shot and their thoughts
    • Go to a store that sells them and visit your site on the test machines
    • Use a testing company (such as uTest) to help test your site on mobile
    • Hire people with devices to test your site
    • Android—The android emulator is available in their developer’s kit.
    • iPad and iPhone/iPad—This emulator is included in the iOS developer kit, which you you have to buy from the Apple store for around five dollars (and is only for Macintosh).
    • Blackberry—There are emulators for several different Blackberry devices, they only work on Windows.
    • Windows 7 Phone—This is a part of the Visual Studio IDE.


What is Design?

Dictionary.com has 17 different definitions for design. The ones that seem most relevant to our work include:

  • to prepare the preliminary sketch or the plans for (a work to be executed), esp. to plan the form and structure of: to design a new bridge.
  • to plan and fashion artistically or skillfully.
  • to intend for a definite purpose
  • to form or conceive in the mind; contrive; plan
  • to assign in thought or intention; purpose
  • an outline, sketch, or plan, as of the form and structure of a work of art, an edifice, or a machine to be executed or constructed.
  • the combination of details or features of a picture, building, etc.; the pattern or motif of artistic work
  • a plan or project

But beyond the formal definitions, there are also the loose meanings that teams working on Web pages assign to the word, including:

  • the person or team responsible for making a site "look good"
  • the look of a website as a whole
  • the look of an individual Web page
  • the work of building a website (as oppsed to planning it or writing content for it)
  • the person or team responsible for coding the website
  • the way the website "works"
  • the images and icons required for a website


Where you place your elements can make a difference?

As they say in real estate, there are three important rules: "Location. Location. Location." If the Mona Lisa were stored in my aunt's garage, it wouldn't have the effect on people that it does hanging in the Louvre. It's still the same painting, but if it were sitting next to cans of old paint, a dirty lawn mower, and a dust covered junker car it takes on the aspect of its surroundings.

Now, I don't think that most people have a "ghetto" location on their Web pages, but effective placement provides the visual hierarchy and structure to your Web page. If you can engage your customers through an interesting and compelling design, you've done half the work.


The Principles of Design

The basic principles of design are true for Web design as well as other design. They show you how to put together design elements in an effective manner. Design is more than just slapping HTML tags up onto a page, and using these principles will help you build more pleasing and useful designs.


Balance is the distribution of heavy and light elements on the page. Larger, darker elements appear heavier in the design than smaller, lighter elements. The principle of balance shows you how to lay out your pages so that they work.


When most people think of contrast, they typically think of colors or black and white. But there is more to contrast than color. You can have contrasting shapes (square vs. circle), or contrasting sizes (large vs. small), or contrasting textures (smooth vs. rough).


Emphasis is what the eye is drawn to in a design. It's tempting to give everything equal emphasis or try to emphasize everything in a design, but this ends up making the design bland and flat. Instead, as a designer you should determine the hierarchy of the page and then apply the emphasis to the elements based on that hierarchy.


Rhythm is also called repetition. Rhythm brings an internal consistency to your Web designs. Patterns are easy for humans to comprehend, and repetition provides patterns that make your site easier to comprehend.


Unity is also called proximity. It is the principle of keeping like elements together and diverse elements further apart. Unity pulls elements together.


How to include Balance in Web Designs

The most common way to incorporate balance into Web designs is in the layout. But you can also use the float style property to position elements and balance them across the page. A very common way to balance a layout symmetrically is to center the text or other elements on the page.

Most Web pages are built on a grid system, and this creates a form of balance for the page right away. Customers can see the grid, even if there aren't any visible lines. And Web pages are well suited to grid designs because of the square nature of Web shapes.


Solving problems in Web Design

Sometimes figuring out what is wrong with your Web design can be very frustrating. Some things can be very difficult or impossible to fix, but if you are systematic about your analysis, you can find the problem and fix it more quickly.

Validate Your HTML

When I have a problem with my Web page, the first thing I do is validate the HTML. There are many reasons to validate HTML, but when you have a problem that should be the first thing you do. There are already many people who validate every page automatically. But even if you're in the habit, it's a good idea to check the validity of your HTML when you have a problem. That will ensure that it's not a simple error that causes your problem.

  • HTML Validator

Validate Your CSS

The next most likely place where you'll have problems is with your CSS. Validating your CSS serves the same function as validating your HTML. If there are errors, that will ensure that your CSS is correct and that is not the cause of your problems.

  • CSS Validator

Validate Your JavaScript or Other Dynamic Elements

As with HTML and CSS if your page uses JavaScript, PHP, JSP, or some other dyanmic elements, you should make sure that they are valid as well.

Test in Multiple Browsers

It may be that the problem you're seeing is a result of the Web browser you're viewing it in. If the problem occurs in every browser you can test, that tells you something about what you have to do to fix it. For example, if you know that the problem only happens in IE 6 or 5, you can create a style sheet or alternate page for that browser, in the event that you can't fix the problem.

Simplify the Page

If validating the HTML and CSS doesn't help, then you should narrow down the page to find the problem. The easiest way to do this is to delete portions of the page until all that is left is the portion with the problem. You should also cut the CSS down in a similar fashion.

The idea behind simplifying is not that you'll leave the page with only the fixed element, but rather that you'll determine what is causing the problem and then fix it.

Subtract and then Add Back

Once you have narrowed down the problem area of your site, begin subtracting elements out of the design until the problem goes away. For example, if you've narrowed down the problem to a specific <div> and the CSS that styles it, begin by removing one line of CSS at a time.

Test after every removal. If what you've removed fixes or completely removes the problem, then you know what you need to fix.

Once you know exactly what is causing the problem begin adding it back with items changed. Be sure to test after every change. When you're doing Web design, it's surprising how often little things can make a difference. But if you don't test how the page looks after every change, even seemingly minor ones, you may not determine where the problem is.

Design for Standards Compliant Browsers First

The most common problems that Web designers face revolve around getting pages looking the same in most browsers. While we've discussed that it can be very difficult, if not impossible, to get Web pages to look the same in all browsers, it is still a goal of most designers. So you should start by designing for browsers like Firefox, which are standards compliant. Once you have them working, you can play with the other browsers to get them working.

Keep Your Code Simple

Once you've found and fixed your problems, you should stay vigilant to keep them from cropping up again later. The easiest way to avoid problems is to keep your HTML and CSS as simple as possible. Note that I'm not saying you should avoid doing something like creating rounded corners simply because the HTML or CSS is complicated. Only that you should avoid doing complex things when a simpler solution presents itself.


What is HTML?

HTML is the language for describing the structure of Web pages. HTML gives authors the means to:

  • Publish online documents with headings, text, tables, lists, photos, etc.
  • Retrieve online information via hypertext links, at the click of a button.
  • Design forms for conducting transactions with remote services, for use in searching for information, making reservations, ordering products, etc.
  • Include spread-sheets, video clips, sound clips, and other applications directly in their documents.

With HTML, authors describe the structure of pages using markup. The elements of the language label pieces of content such as “paragraph,” “list,” “table,” and so on.


Wordpress (145)

How to deactivate all plugins when not able to access the administrative menus?

Sometimes it may be necessary to deactivate all plugins, but you can't access the administrative menus to do so. One of two methods are available to deactivate all plugins.

Use phpMyAdmin to deactivate all plugins.

  1. In the table wp_options, under the option_name column (field) find the active_plugins row.
  2. Change the option_value field to: a:0:{}

Or reset your plugins folder via FTP or the file manager provided in your host's control panel.

  1. Via FTP or your host's file manager, navigate to the wp-contents folder (directory)
  2. Via FTP or your host's file manager, rename the folder "plugins" to "plugins.hold"
  3. Login to your WordPress administration menus (/wp-admin)
  4. Via FTP or your host's file manager, rename "plugins.hold" back to "plugins"


Can I Change The Logo?

Yes, we highly encourage you do so! The logo is a PNG file that is used only as an example. You can easily upload your own image logo in our options panel, or set a text title instead of using an image.


How do I create an archives page, with all the entries sortable by different methods?

Creating an Archive Index shows you how to use WordPress template tags to create a custom archive Page for your WordPress site. There are WordPress Plugins that will also help create customized archive pages.


I used the Quicktag in a WordPress post, so why doesn’t it work?

In some Themes, such as the WordPress Classic Theme, you may see the <!–nextpage–> work properly on your main page, but other Themes, such as the WordPress default Theme, may only show the page break when viewing the posts individually. It may be necessary to change your Theme's template page.php or index.php file to make this feature work according to your wishes. You'll need to add the following:

<?php wp_link_pages(); ?>


Can I place a contact form outside a post?

Yes. You may place a contact form in a text widget as well.


How do I change the Config file?

You will need to update your WordPress configuration file if your database has moved or changed in certain ways.

  1. You will only need to modify the config file if:


    1. your database has moved to another server and is not running on your localhost

    2. you have renamed your database

    3. you have changed the database user name

  2. "'Make a backup copy of your wp-config.php file.'"

  3. Open the >wp-config.php file in a text editor.

  4. Review its contents. In particular, you are looking for the database host entry.

  5. Save the file.

At this point, your WordPress blog should be working.


Why does WordPress only support MySQL? What about DB abstraction?

While in theory supporting more databases is better than supporting one, in practice focusing on MySQL has a number of benefits.

First, introducing support for databases other than MySQL would increase the testing load for all development quite a bit, as already the combinations of PHP versions, web servers like Apache, Lighttpd, and IIS, and Windows vs Linux cause a number of issues, multiplying that by an arbitrary number of database platforms is daunting.

Early on in WordPress' history when DB abstraction was seriously considered we noticed packages like AdoDB were bigger than WordPress itself, which seemed like a lot of weight for little gain.

DB independence also requires far more than just dropping in a DB abstraction class, as basic assumptions WP makes about things like primary keys, indicies, auto incrementing fields, LIMITs, and more vary more from DB to DB than a class could support without serious code changes.

Finally, MySQL is ubiquitous and has shown to be fast enough and scalable enough for the highest traffic loads, so supporting other DBs would not improve the WordPress experience or our popularity much. As a feature request it comes up fairly infrequently.

All that said, every query in WordPress goes through a class called wpdb and that class can be replaced with your own by putting a db.php file in wp-content. So far this has been used for mysqli support and an advanced enterprise DB class called HyperDB, but in theory you could use that, and some wicked regular expressions, to add support for a MySQL-like database without any core code modifications.


How do I link to my own images?

You can use absolute or relative URI/URLs addresses.

To use a relative link, set the address from the root folder of your site by using a slash in front of the folder in the root directory.

<img src="/images/balloons/image.jpg" alt="balloons" />

To use an absolute link:

<img src="http://www.example.com/images/balloons/image.jpg" alt="balloons" />


How can I specify a subject for the email?

Simply edit the Subject field in the Mail section (not in the Form section).


How do I change the size of the popup comments window?

To change the look of the Popup Comments window in WordPress version 1.5, make changes to the comment-functions.php file where it shows the following line:function comments_popup_script($width=400, $height=400, $file=) {.

To change the look of the Popup Comments window in WordPress version 1.2.1 Mingus, make the following change to the template-functions-comment.php on line 50:

function comments_popup_script($width=400, $height=400, 

You can also change Line 81 of wp-comments-popup.php to alter the textarea size for people entering comments.


Yii (36)

What is the component,helper and why are they used, is there other way we can do same thing, what is better?

A component is an independent piece of code written for specific task that can be used by calling in controllers (example : email component), helper is used for helping yii in rendering the data to be shown to user with views, these only adds to modularity in code otherwise same coding can be implemented in controllers.


What if this field is pulled from the database? How do I put in a SELECT list on my add/edit page?

A common situation would be needing a list of countries displayed in a select list, that are pulled from a database table.

Assuming a model named ‘Countries’ (try generating with Gii), the basic code for the view is the following. It makes use of the findAll() method to query all rows in the country database, and CHtml:listData which generates an array of data suitable for list-based HTML elements and the dropDownList function.

echo $form->dropDownList(


Why is $model->save() not saving the record/object/model?

Because save method performs validation CActiveRecord::save

As you can see in the source code:

public function save($runValidation=true,$attributes=null)
    if(!$runValidation || $this->validate($attributes))
        return $this->getIsNewRecord() ? $this->insert($attributes) : $this->update($attributes);
        return false;

If you don't want it to validate just do $method->save(false);

Other possible reason is that "beforeSave" method (if overridden) doesn't return "true".


How to include Javascript and CSS file in Yii Framework?

To include Javascript and CSS file in Yii, put the following lines at the top of your view file:



What is Yii?

Yii is a high-performance, component-based PHP framework for developing large-scale Web applications rapidly. It enables maximum reusability in Web programming and can significantly accelerate your Web application development process. The name Yii (pronounced Yee or [ji:]) is an acroynym for "Yes It Is!". This is often the accurate, and most concise response to inquires from those new to Yii:

Is it fast? … Is it secure? … Is it professional? … Is it right for my next project? … Yes, it is!


How to increment or decrement counter via query builder

The simplest answer would be – don't use query builder for that, use it just for the protocol.

'counter' => new CDbExpression( 'counter + :counter' , array(':counter'=>1))
new CDbCriteria(
"condition" => "id = :id" , 
"params" => array(


What is the naming convention in Yii?

You can define table prefix when using Gii. In your case you need to set it to tbl_. Then it should generate UserController instead of TblUserController.

The Yii Framework employs a class naming convention whereby the names of the classes directly map to the directories in which they are stored. The root level directory of the Yii Framework is the “framework/” directory, under which all classes are stored hierarchically.

Class names may only contain alphanumeric characters. Numbers are permitted in class names but are discouraged. Dot (.) is only permitted in place of the path separator.


What is Yii best for?

Yii is a generic Web programming framework that can be used for developing virtually any type of Web application. Because it is light-weight and equipped with sophisticated caching mechanisms, it is especially suited to high-traffic applications, such as portals, forums, content management systems (CMS), e-commerce systems, etc.


Stop browsers from auto-completing registration form fields

Firefox can autocompleting the username and password fields on registration forms, and change password forms. To disable this, you can set the FORM attribute autocomplete to off. On your CActiveForm options, you can set this in htmlOptions:

'htmlOptions'=>array('class'=>'reg-form', 'autocomplete'=>'off'),


How to change site/page?id=123 to site/page/id

For this you should use urlManager

It is actually very-well documented… URL Manager

The direct answer to the question is – using that rule:

    'site/action/<id:\d+>' => 'site/actionm '

In your example you can set How to change site/page?id=123 to site/page/id$id like this: actionPage($id)

Or you can get it via Yii::app()->request->getQuery('id');


Zend (57)

Tell me about Zend Framework

Extending the art & spirit of PHP, Zend Framework is based on simplicity, object-oriented best practices, corporate friendly licensing, and a rigorously tested agile codebase. Zend Framework is focused on building more secure, reliable, and modern Web 2.0 applications & web services, and consuming widely available APIs from leading vendors like Google, Amazon, Yahoo!, Flickr, as well as API providers and cataloguers like StrikeIron and ProgrammableWeb.


When do we need to disable layout?

At the time of calling AJAX to fetch we need to disable layout.



Can I automate the installation of Zend Server using Puppet or Chef?

Yes, via Zend Server's Web API it is fully possible to not only install Zend Server, but also set passwords and licences. Furthermore, when working in a clustered environment, it is also possible to automate the joining of a new cluster node to a running cluster. Given that the Web API is available via command line calls this can easily be integrated into Chef/Puppet scripts.


How to include css from controller and view in zend

From within a view file:


From within a controller:


And then somewhere in your layout you need to echo out your headLink object:



What is a document root?

The document root is the file system directory in which files need to be placed in order to be run by the Web server. Files placed in your document root can be accessed by browsing to http://localhost:<port_number>/<file_name> . Files and directories under the document root will generally be available for download (if they are static files such as HTML or images) or for execution (if they are dynamic files such as PHP scripts).


I want to use a SQL function or perform calculations in a statement I’m generating with Zend_Db_Select. How can I do this?

Actually, by default, if your expression includes parentheses, Zend_Db_Select will cast the statement appopriately. However, if it does not, or you are having problems, you can use Zend_Db_Expr to explicitly create the expression:

/* Build the SQL:
 * SELECT p."product_id", p.cost * 1.08 AS cost_plus_tax
 * FROM "products" AS p
$select = $db->select()
    ->from(array('p' => 'products'),
        'cost_plus_tax' => new Zend_Db_Expr('p.cost * 1.08'),


How to include js from controller and view in zend

From within a view file:


From within a controller:


And then somewhere in your layout you need to echo out your headScript object:



I have Zend Server 7 but still can’t see Z-Ray, what should I do?

If you are in a development environment, make sure Z-Ray is enabled from the Configurations | Z-Ray page in the Zend Server UI.

If you are in production, we recommend using Z-Ray's Secured Mode, to allow access with IP, URL and time restrictions.

If you still can’t see Z-Ray, there may be a connectivity issue.


How to call two different views from same action

Example 1:

Public function indexAction(){

Example 2:

Public function indexAction(){

Now in your index.phtml you can have this statement to call other view

$this->action(‘action name’,’controller name’,’module name’,array(‘parameter name’=>’parameter value’));


How can I detect if an optional file has been uploaded?

The 'receive()' method will return 'true' for file elements that are not required. The logic behind this is the following "the file can be omitted, and that's ok for me". The 'receive()' method will return false only in the event of a failure.

Still there are several ways to detect if a file has been uploaded or not:

  • Use the function 'isUploaded' which returns a boolean
  • Use 'getFileName' which returns null in this case (note that you must use the latest release for this behaviour)
  • Use 'getFileInfo' which will have an empty 'file' key and the flag 'isUploaded' set to false


Marius Ion ANGEL HOT SOFT LLC (800) 316-7677