Recently, I was given a consulting project to develop an e-commerce site and I immediately thought of Magento - an open source e-commerce solution written in PHP. Magento is one of the better pieces of software that goes widely unknown by many since very few people develop e-commerce sites (as opposed to say Drupal where everyone and their kids are bloggers).
However, upon installation of Magento on my GoDaddy Linux Virtual Dedicated Server (VDS), the installation will stall on the mcrypt dependency. The mcrypt library stores several algorithms that help secure your e-commerce site's data. Unfortunately, by default, the GoDaddy VDS package does not have the mcrypt library installed. To install mcrypt, follow these steps -
Once the server has restarted, you can re-run the Magento installation and you will be able to successfully complete the wizard.
IBM has created yet another great tutorial this time covering how to read files using PHP. This tutorial covers such functions as fopen, fclose, feof, fgets, fread, readfile, fgetss fpassthru, fseek and fscanf. IBM masterfully breaks down each function and gives the reader a good idea what the best practice is in using each of the functions.
Posted By: hagrin
Date: 14 November 2005
Overview:
In order to run a well-known, successful website or blog, Internet users must be directed and drawn to your site. The draw comes from the content you post and create, but how do people know about the content you have posted on such a vast cyber world? Internet based companies have identified the need to centralize data and content offerings by offering indexing services. Such services, such as Google Blog Search, Technorati and Weblogs Inc., are indexing services specifically designed to publicize blogging content. However, unlike Google's main search engine, these services do not crawl the Internet on their own to find new content. Instead, these services need to be contacted by the blog/site owner either through a manual "pinging" or by automatically pinging the service through a remote procedure call. Obviously, webmasters do not want to maintain manual processes to promote their site so automatically contacting these indexing services is preferred. The following explains how to accomplish automatic blog pinging utilizing PHP and XML-RPC.
What You Need:
To automate the blog pining process, you will need the following:
Automation Process:
Now that you have the tools needed to complete the process, an implementation plan is needed. So where do we begin?
1) Where and when should the pinging process occur? - For the most effecient and effective result from automatic pinging, you want to choose a place in your posting procedure that ensures that an automatic ping signals new content on your site. For 99% of blogs, you will want to add the necessary code after a successful post or publishing of new content. Why? Well, simply, since your blog has fresh, new content, you will want to notify all blog indexing services immediately. However, for sites that post new content in extremely large quantities (which isn't suggested since most users will not want to sift through 50+ new posts a day), you might want to consier adding the code in an hourly cron job because you do not want your site to get delisted for abusing the pinging service and "flooding" their services.
2) The Actual Code - So, after determining that you want to add your code after a successful post/publishing of your blog, let's examine exactly what you will need to do. Most likely, you have written code (or see code if you are using a third party app) that holds a SQL Insert statement. After the SQL query code, you need to add the PHP code necessary to ping the blog indexing services. That code should look something like the following:
require 'weblog_pinger.php';
The "require" statement should be followed by the correct path for where you saved the weblog_pinger.php file (item #3 from the "What You Need" section). In the example above, the PHP page that performs my post submissions and blog republishing is located in the same directory as my weblog_pinger.php file. After the require statement, you should add:
So what does this code do? The first line says to use the variable $pingblogs (you can name the variable anything you want, I chose $pingblogs arbitrarily) and create a new object instance using the Weblog_Pinger class. This class is specified in the weblog_pinger.php file you "required" above. The second line uses our new $pingblogs variable and calls the ping_all function which will send your information to three sources - Technorati, Weblogs and Blo.gs (there are other functions available to call, but for the purposes of the tutorial, I chose to use the ping_all function for simplicity). After the calling of the "ping_all" function, you will notice 4 items encapsulated within quotes and separated by commas. The first item declares the name of your blog (in this example, "Name of Your Blog"). The second item, http://www.hagrin.com, specifies the URL where your blog is located. Item three, which I have left without a value, is the "change URL". This URL represents where the actual new content is located. It is not necessary to declare a change URL - the default value automatically returns the URL where your blog is located (the second item in the ping_all function). Last but not least, the fourth item holds the category your blog should be submitted into (the default value is none).
And that's it!!! You don't need any additional code to get the basic features working which are good enough to get you listed in all the blog indexing services you need to promote your content.
Resources:
Version Control:
The Google Code blog announced the availability of Google Data API support using PHP 5 through the Zend Framework. Zend, who I know better for making one of the best PHP IDEs around, has developed their Google Data Client Library which "provides a PHP 5 component to execute queries and commands against Google Data APIs from your PHP applications".
Now, I just need to get a webshost who will upgrade to PHP 5 (not to mention, update their version of python).
Zend, the creators of one of the best PHP editors, released a tutorial depicting Paypal implementation on your PHP based website. The tutorial is great for any web programmer looking to do consulting work and building e-commerce websites with Paypal functionality (I know I bookmarked this link immediately). This is a must have for the freelance PHP programmer.
Ice Melon has a great tutorial on how to create dynamic text over images. I've seen this a few times (on some *cough* non-technical websites) and have always wondered how to do it and now here's the PHP tutorial. Definitely give it a look as it may open your eyes to the power of PHP.
PHP 5.1.0 has been released fixing numerous bugs and security issues.
One of the big complaints by users over at Slashdot were the lack of namespaces being included in this PHP release. The problem that this causes for PHP developers is that they have to prefix all classes used with a unique prefix. The PHP development team has discusssed how to address this issue, but there still hasn't been a namespace patch released. Persoanlly, I haven't run into too many issues with the lack of namespaces; however, my .Net experience has shown me the power of namespaces.
Recent Comments
3 weeks 2 days ago
3 weeks 3 days ago
5 weeks 4 days ago
7 weeks 4 days ago
1 year 13 weeks ago
1 year 13 weeks ago
1 year 14 weeks ago
1 year 15 weeks ago
1 year 18 weeks ago
1 year 19 weeks ago