PHP: Adding Parameters To A URL in PHP

  • Post category:PHP
  • Post comments:0 Comments

PHP: Adding Parameters To A URL in PHP
Adding Parameters To A URL in PHP

This article shows how to add query parameters to a URL in a php script. It is aimed at the beginner to intermediate level PHP programmer but developers from other languages may find some useful information here. At first this seems like a simple enough task. Starting with the url as a string, just add the new parameters to the end. Yeah, that would be nice. It turns out that there are a few conditions that make the process just a bit more difficult. It’s still not a hard problem but there are enough special cases to make it interesting.
(more…)

Continue ReadingPHP: Adding Parameters To A URL in PHP

Magento: Problem with reindexing process for “Product flat data” indexes

Problem with reindexing process for "Product flat data" indexes
Problem with reindexing process for "Product flat data" indexes

Symptoms

Reindexing of Product flat data index gives unknown reindexing error or “Some problem with reindexing process” error message or reindexing of Product flat data index is never completed.

Attempt to reindex it via command line gives the following error message:

$ php -f shell/indexer.php -- --reindex catalog_product_flat
Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (<result 2 when explaining filename '#sql-'>, CONSTRAINT ´FK_CAT_PRD_FLAT_1_ENTT_ID_CAT_PRD_ENTT_ENTT_ID´ FOREIGN KEY (´entity_id´) REFERENCES ´catalog_product_entity´ (´entity_id)' in lib/Zend/Db/Statement/Pdo.php:228

(more…)

Continue ReadingMagento: Problem with reindexing process for “Product flat data” indexes

Magento: Automated Bash Script Installer

Magento: Automated Bash Script Installer
Magento: Automated Bash Script Installer

The following SSH script will automate the process of installing Magento, with or without sample data. It will walk you through everything, and the only thing you need to setup first is the database and assign a user to the database.

You will need SSH access to use this. SSH is similar to FTP, in that it requires software that you’ll need to download in order to connect to your site. If you don’t have an SSH client, you can download PuTTY for free.
(more…)

Continue ReadingMagento: Automated Bash Script Installer

CSS: Drop Caps

  • Post category:CSS
  • Post comments:0 Comments

CSS: Drop Caps
CSS: Drop Caps

Use the first-letter Pseudo-Class

The easiest way to create CSS Drop Caps is to use the first-letter pseudo-element on the element you want to have a drop cap. The problem is, this isn’t supported in all browsers. Be sure to test this in the browsers your Web site supports.

Type the following and place it in a

element at the top of your Web page:
(more…)

Continue ReadingCSS: Drop Caps

CakePHP: Understanding the MVC Pattern

  • Post category:CakePHP
  • Post comments:1 Comment

CakePHP: Understanding the MVC Pattern
CakePHP: Understanding the MVC Pattern

The MVC (Model View Controller) pattern is a commonly used design pattern in software development, where the code is separated into three major parts: models, views, and controllers. The exact purpose of each part depends on the implementation, as it may vary from one framework to another. Here, we are going to describe the way CakePHP implements the MVC pattern. So, this is not a general discussion on MVC pattern, rather we are only going to see Cake’s own MVC implementation. As we have already mentioned, CakePHP separates the code into three separate parts: models, views, and controllers.
(more…)

Continue ReadingCakePHP: Understanding the MVC Pattern