Posts

Php: Manage session times using code - Expiration / Timeout script

The following article demonstrates how to take control of php session times by including a php script into pages on your site. This can be useful if you don't have access to the php installation and the php.ini configuration file, as it gives you the flexibility to choose the length of php sessions on your site without requiring access to the server or config.

IE / Firefox Alignment Issues Solved

When testing the layout of a website template that I was creating in Internet Explorer (IE) and Firefox, I had a lot of trouble getting both browsers to display the content as required. The main content is a fixed width, which is in a panel (div) that should be centered. Setting the css property text-align to "center" works for IE, but not Firefox. After doing some research, I found that FireFox has a specific CSS attribute to center align content: "-moz-center ". This fixed the problem for Firefox, but the everything was left aligned in IE. After a bit of playing around with combinations of styles and attributes I managed to have both Internet Explorer and Firefox render the page properly using the same style sheet and set of styles. My solution: Set the alignment for Firefox in the attached stylesheet for the required div elements: text-align: -moz-center Set the alignment for Internet Explorer using the align attribute of the div element: <div align="cen...

Search Engine Optimization (SEO) for Blogger

Looking to increase visits to your blog? While doing a little research around SEO for my own blogs, I came accross the following article by Mike which offers a method of adding keyword and description metatags . Blogger SEO Tip: Use Post Labels as Meta Keywords The code incorporates conditions to show the labels / tags for a post as keywords if a post page is being viewed. If the blog homepage or a search page is being viewed, the blogs keywords abd description are used.

XML-RPC Blog Ping

I am developing a Php script which uses the Weblog_Pinger class written in php by Rogers Cadenhead. The script currently logs all pings to a MySQL database table, but is controlled using a single php script which calls the ping_ping_o_matic function for each site. I noticed that once more than about 20 sites were being pinged, the script sometimes timed out. Instead of adjusting settings in php.ini or the web server, I decided to implement the Weblog_Pinger class with a controller which uses a MySQL database to store addresses to servers which support XML-RPC pings. The database will also store details of the blogs / rss feeds being submitted. When commencing the bulk ping, a dialog will allow a selection from the list of blogs / rss feeds, and the "changes url" for each selection to be specified. The php interface will also allow XML-RPC servers and additional blogs or rss feeds to the database.

SEO - Crawler interpreting external links

The following is in relation to my previous post Php: Log Clicks on Links to External Sites . The post demonstrates how to log a clock on a link pointing to an external address. This may cause some search engines to get confused when crawling the page, as the link will be pointing the the load.php script on your site, when it actually reads and takes the user to an external site. A solution for this would be to use the actual address of the external site as the value for the href attribute, and call a javascript function which changes the href value to toint to the redirect script which logs click / hit statistics. Links would then appear to search engine crawlers to point to the correct address, and not a page on your site. If javascript is not enabled, the user will still reach the required destination, but statistics for the click will not be logged.

Php: Log Clicks on Links to External Sites

The following demonstrates a method of logging clicks on hyperlinks to external sites using Php and MySQL. This can be used to generate statistics for content on your site such as "Popular links/sites", or keeping track of a frequent user or member's actions (ie. Recently Browsed). The Php uses the PEAR MDB2 Package to create a connection to the database. For information on installing or using PEAR and the MDB2 package, see http://pear.php.net/ . Once the processing has completed for the item/link, the user is redirected to the address of the selected url.

XML Parser

The following php code processes an xml file and displays contents in the browser. Each element is displayed, followed by the name and value of any attributes. The text value will be disaplyed on if the element is not empty. It uses various methods from the XMLReader class (php), to move through each element and attribute of the xml document displaying each element and attribute name, and any values.

Free online webmaster, web development and web design tools and resources

The following is a set of free tools and resources which can be used to help create valid and attractive websites in a short amount of time.

VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String

VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String Original Post: 21st April 2009 Updated: 16th March 2010 The following VBScript / VBA function removes special (illegal in file names) characters from a string and returns a clean string. Illegal/special characters are replaced by a space by default, but can be set to replace specific characters with another string/character. The function can be used to remove characters not supported in filenames and directory names of the file system, SharePoint lists, etc.

Free Php RSS 2.0 feed generator class (RSS2Writer)

RSS2Writer v2.1 has been updated to v3.0 beta.  The new version can be downloaded at the Php FeedWriter website:  http://phpfeedwriter.webmasterhub.net/ Php FeedWriter (v3.0 beta) now provides the ability to output to various feed formats.  Php FeedWriter can currently generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91 compatible feeds .  View more information about Php FeedWriter , including online documentation .  For information about the latest update and release, see the article Php FeedWriter 3.0 (beta) Released . A tutorial demonstrating how to build a feed using Php FeedWriter is also available on this blog: How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible) [Edit: 9th January 2010] This Class has now been updated to Version 2. The information provided in this post is now out of date . Please see the Php RSS2Writer Class page for information about the updated version (Version 2.0). Updated Version (2.0): Php RSS 2...

Microsoft Outlook: Calling VBA Class Module function using VBScript

Although it is not recommended by Microsoft (see below), a procedure can be created in VBA (Visual Basic for Applications) and called using VBScript (Visual Basic Scripting Edition). By default, VBA is not initialised disabled when Outlook is started for performance reasons. If Outlook is started and an item opened (containing VBScript which calls a VBA procedure in the ThisOutlookSession Class Module), an error will occur as the required VBA procedure/function will not be available. For procedures to be called from the ThisOutlookSession module, security settings need to be adjusted to allow the macros to run. To call a VBA procedure in the ThisOutlookSession module from VBScript, create an Outlook. Application object, which will then allow the procedure to be called.

Privacy Policy

Third-party advertising companies are used to serve ads when you visit this blog. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here .

New Web Development Blog

This is my new web development blog location. Posts will be related to web development, php application development, general html javascript and css. Please have a look at my SharePoint Administration and Development blog.