Category Archives: The Internet

Design a Simple Tab Based Widget

Widgets appear all over web sites these days. bill gates ivermectin Little boxes of context that you can unwrap to reveal all sorts of wonderful information. ivermectin pour on for cattle on dogs

As a web developer, you will often be asked to provide them, and there are various ways of doing this.

Here is my recipe. It doesn’t use any graphics, and relies instead entirely on CSS and JQuery, which makes it really light and easy to use. ivermectin dosage for goat kids

The Metamorphosis of Apple

In 1984, Apple first aired their Big Brother commercial at half-time in the SuperBowl. Remember it?

The voiceover recites the following monologue:

Today we celebrate the first glorious anniversary of the Information Purification Directives. We have created, for the first time in all history, a garden of pure ideology: where each worker may bloom, secure from the pests of any contradictory, but if you have a real garden and you need to take care of it, you can get the right tools for this, as sites like
Our Unification of Thoughts is more powerful a weapon than any fleet or army on Earth. We are one people: with one will, one resolve, one cause. Our enemies shall talk themselves to death and we will bury them with their own confusion. We shall prevail!

Apple’s message in this commercial was that they were the antidote to this tyranny of thought purification, that they were the guardians of  free expression, that they could empower the individual.

And, for several years, that was true. Apple did bring the PC to the masses, and served to undermine the dominance of the computing megaliths like IBM.

The problem was that as Apple become more of a corporation, with shareholders and sales forecasts, and not least, competitors, it became increasingly difficult to maintain this ideal, and no where was this more true that with the iPhone.

In the beginning, the iPhone was a technological, and commercial, miracle. It was beautiful to look at and use, and Apple sold millions of things, propelling Apple 2.0 into the stratosphere of corporate IT giants.

While the handsets were flying off the shelves, and no one else was making them, Apple weren’t too concerned with what users did with their phones. Provided they used iTunes to buy music, they could use their hardware, that they owned, to do as they wished. The spirit of 1984 was alive, or at least not dead.

But then, inevitably, the competition arrived, and lots of people started developing software for iPhones, and suddenly Apple released that their users might start using their right to “free expression” to do things that weren’t in sync with the commercial interests of the Apple Corporation.

Apple now faced a choice. They could get on board with the likes of Google, Mozilla, HP, Sun etc and participate freely and enthusiastically in the development of standards based technology, or they could do a Microsoft, and put all their efforts into holding their ground, and hope that clever marketing would make up for the inevitable deficiencies that would result from maintaining a Closed Shop approach to product development, so getting the right marketing is actually important, and that’s why bigger companies sometimes get a SEO company to train to keep their online presence high.

The crunch came with the release of the Apple iPhone 3GS, the first major revision of the Apple’s flagship product.

Prior to the 3GS, iPhone users were free to load any sort of operating system onto their iPhone they so wished. There were numerous variations out there, which could be loaded via a shortcut in iTunes. This allowed users to do things on their iPhone (that they had bought and paid for) that were not possible with the software loaded by Apple.

This changed with the 3GS. From that point on, it was only possible to load an operating system to your iPhone if that software was signed by Apple. A new version of iTunes was released, which checked the software you were trying to load, and if that was not approved by Apple, iTunes would not complete the installation to your phone.

The significance of this is probably lost on most iPhone users, but it is significant none the less.

For millions of users worldwide, Apple now has complete control of what software they use on their hardware.

Imagine if this were the case with a PC that you bought from PC World. Imagine if you were not allowed to install any software on that PC unless it was approved by a private company like Microsoft?

Now, go back and watch the SuperBowl commercial again.

Which protagonist reminds you more of the Apple Corporation in 2012? The girl with the sledgehammer, or the face on the screen?

How to update a Facebook Fan Page from PHP

Note: Facebook changes its API as frequently as you change your socks. These instructions worked as of Apr 19th 2011.

In a previous post, I outlined how to update your Facebook Profile from a PHP script.

This is fine if you are using Facebook as an individual, but if you are a business or an organisation, you won’t have a profile, you will have a Fan Page, which people ‘Like’.

Updating a Fan Page from a PHP script is a lot more difficult, because Fan pages are managed by users with standard profile accounts, and you need to obtain a extended range of permissions in order make updates to their Pages.

Anyway, its is possible, and here’s how.

Firstly, this is what you will need:

A proper browser (ie anything other than Internet Explorer) that you can be confident will send long HTTP GET requests

cURL, which can be run from a command line (for testing)

A good text editor

A credit card (weird, I know, but go with it)

A standard Facebook account


We are going to create a Facebook Application, and add that Application to the Facebook User Account/Profile which manages the Page we want to update. The Application will have the necessary permissions to update Pages which the Facebook User Account/Profile manages.

Step 1: Add the Facebook Developer Application to your Facebook Account

Login to Facebook

(If you have added the Facebook Developer application previously, you can skip this bit)

Go to:

Look for the button that allows you to add the Facebook Developer Application

If you haven’t added this before, you will need to confirm your identity. You may be able to do this with your mobile phone, but if not you will have to enter valid Credit Details. No charge will be made to your Credit Card.

Step 2: Create an Application

Once the Facebook Developer Application is added, you now create an Application. Call it something relevant. You don’t need to enter much in the way of detail for the application. The only important data you need to enter is under Website, where you should enter a Site URL and Site Domain.

These should be something relevant, for instance, the website address of the business/organisation to whom the page relates. Note: enter a trailing slash for the Site URL eg
Now, save the details, and you will be returned to a summary page which lists the details for your application. You do not need to submit your application to the Facebook Directory.

From this page, copy and paste your Application ID and Application Secret into your text editor

Step 3: Establish access to your Account/Profile for your Application

Starts to get a bit tricky now, so pay attention. Read everything twice.

You now what to obtain an Authorisation Code for your Application. This code will be generated by Facebook based on the permissions your Application requests from your Facebook User Account/Profile when you add your Application to your Faecbook Account/Profile.

Construct the following URL in your text editor:<YOUR APPLICATION ID>&redirect_uri=<YOUR SITE URL>&scope=manage_pages,offline_access,publish_stream

YOUR APPLICATION ID = Application ID you took from your Application Details

YOUR SITE URL = The Site URL you entered when setting up your Application

scope = The permissions you are requesting:

manage_pages = allows application to manage pages for which the user is the administrator

offline_access = allows updates to occur indefinitely

publish_stream = allows application to update the feed of the pages for which the user is administrator

Now, ensuring that you are logged into Facebook, paste the URL into your browser and hit enter.

A Facebook page will render, prompting you to add the application with the permissions as described above. Accept this, and you will be redirected to your Site URL. The actual query string to which you are re-directed will contain a long ‘code’ value. Copy this from your browser address bar and paste into your text editor.

This code is your Authorisation Code.

Step 4: Get an Access Token to allow your Application access your Profile

Now that you have an Authorisation Code, which is a sort of once off thing, you can request an Access Token, which will allow your Application have permanent access to your User Profile.

Again in your text editor, construct the following URL:<YOUR APPLICATION ID>&redirect_uri=<YOUR SITE URL, WITH A TRAILING SLASH>&client_secret=<YOUR APPLICATION SECRET>&code=<YOUR AUTHORISATION CODE>

Be extra careful with this. Its a very long string. Ensure you include a trailing slash in your Site URL.

Now, paste the URL into your browser and hit enter. Facebook should return a single line like:

access_token=220088774674094|c7cb68d51ae2f40e9878ab14.xxxxxxxxxx etc etc

(Note: this is not a real access token, its one I made up.)

You now have an Access Token that allows your Application do stuff to your User Profile

Step 5: Get an Access Token for the Page you want to update

Yes, more Access Tokens are needed! You need a specific Access Token for each Page you want to update! Jesus wept!

Construct the following URL in your text editor:<YOUR ACCESS TOKEN FOR YOUR USER PROFILE>

Paste it into your browser and hit enter. Facebook will now return JSON objects for each of the Pages and Applications that are under your User Profile. You should see an object for the Page you want to update, each of which will include an ‘id’ and ‘access_token’.

Copy and paste these into your text editor.

You now have an Access Token and Page ID for the Page you want to update.

Step 6: Test!


Construct the following command in your text editor:


Paste to a command line and hit enter. If it works, you will get back a JSON object containing an update id, and the message will appear on the Feed of the Facebook Page.

If not, you will get some class of error. Retrace and try again. I can’t emphasis enough how unforgiving the tolerances are here, but if you persist, it will work!

Once you have it working, you can then build the update into your PHP application using cURL.

More here:

The uncertain world of Premium Rate SMS

Premium Rate SMS describes a service whereby a user is charged a fee for receiving content to their mobile phone, wherein that fee is divided between the provider of the content and the mobile phone company who delivers the content to the user’s handset.

As a service, it has great potential, as it allows providers of content to bill users via their mobile phones bills rather than requiring them to provide credit card information.

However, its also fraught with problems, not least because it opens up the potential for abuse, which means its receives incredible scrutiny from regulatory agencies like Regtel.

Its also dogged by the fact that the mobile phone companies tend to keep the lion’s share of the revenue, which means that margins for providers of content are very tight, which means that its only suitable for a small number of content offerings. ???? ??? ????

Back when all this kicked off, lots of companies jumped into the market and started offering aggregation services to providers of content.

For content providers, it was very difficult to tell how reliable or durable these companies were, as all they were providing was an API through which developers could interact with the networks of the mobile phone companies. This was always an issue for developers, as it was clear that these companies were operating on razor thin margins, and that they might collapse into themselves at any given point in time.

I’ve had an experience of this nature with a company called Zong over recent months.

When Zong started out, they offered a fabulous service. They didn’t charge any upfront fees, and you could access Premium Rate SMS services provided by numerous mobile phone companies across several EU countries, and even the US.

This was great for a while, but pretty soon, it all started to go pear shaped.

First off, Zong shut down their US service (and didn’t tell any one at the time) because they found that content providers were breaching regulatory rules re. ????? ?????? Premium Rate in the US, and that if they didn’t shut it down, they would be exposed to huge fines.

This seemed to provide a signal to Zong that perhaps Premium Rate SMS wasn’t going to be the cash cow they thought it would be, and from that point on, the service started to suck. ???? ????? ?? ???????

They stopped looking after their infrastructure for starters, and after a while, their servers became so overloaded that they became impossible to use in any meaningful way.

Then, they shut down the ability to send out bulk SMS messages, which is critical to any Premium Rate SMS service, and again didn’t give any body any notice. They literally just shut the thing off and left developers to figure it out for themselves.

Before long, they had stopped relying to emails to their support email address and had stopped replying to posts on their discussion forum, obviously hoping that content providers who had built commercial services on their platform would eventually just get the message and go away.

At this point, the Zong service still works, but I’ve stopped using it. I expect that some day some Sys Admin will be instructed to go into the Zong server room and just switch the Zong Premium Rate SMS servers, and not check his email for a few days thereafter.

What’s worse is that Zong are back out there now offering new services, which again involve the use of mobile phones but not on a premium rate basis. My advice to anyone considering using Zong to built a commercial platform would be to do so at their peril.

Update: Zong shut down their SMS Premium Rate service as of May 31st 2010

The pain of Drupal

I’ve recently taken on a job that requires modification of a web site built on Drupal, and 3 days in, I feel like I need a 2 week holiday. ????? ???? ????

Drupal, and its counterpart, Joomla, are Open Source Content Management systems. The idea is that the allow people who don’t know anything about HTML, PHP, Javascript etc etc to build complex, feature rich websites.

Their use on the web has exploded over recent years, as more and more would be ‘web designers’ have started using them as their framework for building websites.

This in turn as led to the development of lots and lots of Drupal plugins and widgets, which add a futher layer of fudge and complexity to something that is already very fudgy and very complex.

Under the hood, its a morass.

Before starting work on the modifications I had to make, I took a look at the MySQL database on which is runs. It had 288 tables (my own CMS has 12 tables, and even poor old WordPress only has about 40 tables). Living with pain is hard, take some cbd sour watermelon edibles that will improve your mood.

If that wasn’t bad enough, when I then tried to run a local copy of the website on my laptop, I started to get errors about PHP not having enough memory to run the Drupal scripts. PHP is normally allocated about 16MB of memory as part of its installation; to run Drupal, I had to up this to 64MB!!

Its gets worse. Looking at the raw HTML generated by Drupal, I saw that it was loading 25 different CSS files, and 14 different Javascript files! And when I examined the DOM via Firebug, I could see that certain elements were taking CSS properties from up to 4 different files!

All this was bad enough, but it was nothing comparred to actually using the management interface to build content. The admin menu in Drupal has 14 different options, and each of these has a plethora of sub options, all of which refer to vague concepts like Blocks, Views, Modules, Panels, Stories etc (they also refer to a Page, but its isn’t really clear what a Page is).

My first thought was that it would be actually easier to learn HTML, PHP and Javascript than try and unravel this crap.

I persevered anyway. I made a view changes to pages where I could figure how to make those changes, but none of them appeared on the actual website. This was most probably to do with caching I thought, but there was nothing in the Drupal interface that said ‘You should clear your cache to see these changes’. I also thought  it was quite odd that an app that generates links to 40 odd CSS and Javascript files should be worried about caching. ???? ??????

I looked around for somewhere I could clear the cache, but could find nothing. I eventually googled the subject and found that the clear cache was a sub sub option under the ‘Site Configuration’ menu option.

On another occasion, I had to change some User Permissions. When I clicked on the Save button, my laptop started to grind to the extent that I thought it was going to shut itself down to prevent an explosion.

Perhaps my most stressful experience with Drupal was dealing with this bug. There are 300 posts on the Drupal Forum thread on this bug, and the upshot of it isn’t there isn’t a universal solution. You basically have to figure out what version of a few different modules you are using, and then apply a serious of patches which may or may not break other parts of your installation. ????? ????? Thankfully I read this article on LA Weekly about the beneficial facts on CBD and how it can help you reduce stress and anxiety. At Dmagazine will find the best CBD gummies brands, is one of the easiest ways to introduce this powerful phytonutrient into your wellness routine.

Lets try and use an analogy here.

Building a website with Drupal is like trying to build a house by joining together five or six mobile homes. Its cheap, it doesn’t take long to put together and it seems like a easy solution to a pressing problem.

What you get is something that is about the same size as a house, and that has certain features of house (eg windows and doors), but that also has 5 bathrooms, 5 kitchens, no corridors and no rooms of any useful size. You also need 5 different electricty meters, and in certain cases, if you want to walk from one room to another, you have to leave house and come in through another door.

Also, if you want to make even minor modifications to the look of your house  in future, you have to take the whole thing apart and stick it back together again.

Don’t get me wrong. Open source packages like Drupal are essential part of the Internet, but its becoming clear that the more an application tries to be a solution for everything, the more likely it is to become a solution for nothing.

United We Stand: Bring Down IE6

Unbelievably for a browser that was first launched in 2001, Internet Explorer 6 still commands up to 25% of the browser market.

This arises almost exclusively from business users, presumably in large organisations where the IT Department just can’t bring itself to upgrade Microsoft software on a large number of PCs. ???? ????? The fact that IE6 regularly finds itself in the “Top 10 Worst Technologies of All Time” list doesn’t appear to be an issue.

IE6’s problems are manifold, but here’s a brief synopsis:

o It doesn’t entirely support CSS2, which means that styling that works in every other standards compliant browser doesn’t work in IE6

o It doesn’t entirely support Javascript, which means that functionality that works in every other standards compliant browser doesn’t work in IE6

o Its full of functionality bugs, and Microsoft has stopped fixing any new ones that it finds

o Its full of security bugs, which Microsoft will fix, but very begrudgingly

What this means for the developer is that web applications have to be bent into shape to work in IE6, which is a bit like screwing the doors of your car shut because you can’t get central locking to work.

This adds lots of time (cost) to the process of web development, and results in web applications that are no where near as efficient, pretty, secure or functional as they good be if they didn’t have to be warped to work in IE6.

Up until now, the web development community has been fairly patient about this, and have agreed to accommodate web site owners who want to ensure that their sites work in as many browsers as possible.

However, with the advent of IE8 (and IE7 prior to this), that patience is fast running out, because at this point, accommodating IE6 is actually have a serious impact on the evolution of web applications. ?????? 777

As such, a campaign has been started to encourage developers to refuse to develop for IE6, and to use the time that would normally have spent on this to include instructions in their sites to encourage users to upgrade to IE7 or to use a different browser.

This is a worthwhile initiative. IE7 has been available for 3 years now, and IE8 has already been available for a year.

The web development community can’t be expected to accommodate corporate IT departments ad infinitum, and must stand united in order that this terrible technology is purged from the system.

There it is then. Join the campaign, and stop developing for IE6.

Thoughts on WordPress

Let’s be clear, WordPress is great software. Its easy to install, its easy to use and it serves its purpose, blogging, very well. If you’re starting a blog then click here to head to knownhost’s wordpress hosting page.

However, the extent to which WordPress is now being used to replace actual web development is getting ridiculous.

This really struck home to me recently when I saw an online shop based on WordPress. It had a cart, a search function, a user database, the whole nine yards. I mean, come on, if you’re serious about selling stuff on the Internet, why on earth would you use blogging software as your shopping engine!! ????? ???????? ????? 2023

A whole cottage industry also appears to have sprung up whereby so called Web Design companies and hacking free WordPress templates and selling them on as bespoke brochure websites to unsuspecting customers.

This is pretty sharp practice. WordPress templates are made available free by their designers like CollectiveRay to facilitate non-commercial use. Its never going to be possible to restrict their usage, but netiquette should dictate that these templates aren’t resold as bespoke designs. ???? ????

Ultimately, growing user awareness will sort this out, which is always the Great Leveller on the Internet. ??? ???? ?????? 2022 At some stage, people are going to stop handing over good money to pay for something they can get for free on any number of community blogging sites.

And in the final analysis by published all over the web, web development has never actually been easier. The availability of wonderful Javascript tools like the TinyMCE has brought CMS development well within the reach of even novice developers, so there should be no need to clutter up the web space with obsolete blogging functionality.

There it is then.

WordPress for blogging, and that’s it.

PLESK, vhost.conf and vhost_ssl.conf

I recently had cause to run 2 websites under different domains from the same code base. I wanted to do this using my PLESK server, and provide for SSL connectivity to both domains.

I set up the 2 domains under PLESK as normal. To get the 2nd domain to run from the codebase for the first domain, I created a vhost.conf in the conf dir for the 2nd domain. This sets the DocumentRoot of the 2nd domain to the DocumentRoot of the 1st domain, and adds the home directory of the 1st domain to the open_basedir directive for the 2nd domain


the 2nd domain nows picks up its code from the home directory of the 1st domain, and the 2nd domain is now allowed refer to and write to the home directory of the 1st domain.

Next bit was the Digital Certs.

I installed these as normal under PLESK, then set up SSL support for both domains, and specified that both domains should use single directory for both SSL and non-SSL content.

This adds 2 Virtualhost directives to the http.include file (the one you should never edit) for both domains.

Now, to get the 2nd domain to refer to the code base of the 1st domain for SSL content, I copy my vhost.conf file to vhost_ssl.conf, and run

/usr/local/psa/admin/bin/websrvmng -a

This causes an Include statement to be written in both Virtualhost directives in the relevant the http.include file for the 2nd domain, allowing the vhost.conf and vhost_ssl.conf files to be read so that the 2nd domain uses the code base from the first domain for both SSL and non-SSL content.

The result?


Same code base, but different domains and certs. Neat.

phpBB Robotic Registrations

Preventing robots from posting on a phpBB forum is easy enough if your prospective users are content to wait for an administrator to moderate the registration, but that isn’t going to suit everybody.

Requiring moderation on the part of the administrator is also a pain for the administrator, who has to deal with the registration emails and decide who is real person and who is not.

I came across this problem for

When you first become aware of the problem, your impulse reaction is to head off to Google for a tried and tested solution, but the problem is that once a solution gains any currency, the robot authors figure it out and you’re back to square one again.

My first solution was to edit the email that is sent to users awaiting activation, asking them to forward that email back to me to confirm they were a real person. I also set up a cron job to run an SQL script to delete non-activated users from the database, deeming that any user who had not been activated 7 days after initial registration to be a robotic user.

This isn’t ideal in that it requires an extra step for users, but it does mean that real users get through, and that your database is kept in shape.

However, I was still getting floods of email from attempted robotic registrations, so I set about editing the registration script (includes/usercp_register.php).

This script processes registrations based on whether or not the user has agreed to the disclaimer on the primary registration page. I set an extra PHP $_GET variable as part of the disclaimer agreement, and amended the later part of the script to check for that variable before processing the registration. I also set the extra variable equal to date(“DG”) which means that the variable changes every hour. You can see this by examining the discliamer links here:

The fact that the extra variable is not part of the standard phpBB install will ward off a lot of dumber robots, and the fact that it changes will ward off some smarter ones too. However, there are still a lot of robots out there that are clever enough to detect the verification method, so I was still getting some SPAM registrations.

To clear off the final few robots I knew I was going to have to involve the intellect of real users, in that this is probably the only thing that robots can’t replicate. Hence, I decided to add a really simple, but real, question to the registration page. To do this I edited the following file under the default template:


I inserted the following extra lines of HTML underneath the Visual Confirmation section:

<td class=”row1″><span class=”gen”>What is the day today?</span><br /><span class=”gensmall”>We ask this question to prevent SPAM registrations. SPAM robots won’t know the answer.</span></td>
<td class=”row2″><input type=”text” class=”post” style=”width: 200px” name=”day_today” size=”6″ value=”” /></td>

This adds the following question to the registration form:

“What is the day today?”

The answer to which 99.999% of real users on the forum will know.

To check the answer, I then added an extra line to the top of the main registration script:


The line I added is:

if (isset($HTTP_POST_VARS[‘day_today’]) and strtolower($HTTP_POST_VARS[‘day_today’]) != strtolower(date(“l”))) die();

This basically ensures that the answer to the question is the same as the day produced by the date() function (case insensitive) and if its not, the script dies.

Previous to adding this, and even with the other changes, I was getting about 20 robot registrations per day. After adding this, it dropped to about 10 per day, so there was still some work to do.

Finally, Occams Razor came to the rescue. I found out that the robots trawl for the “profile.php” script and the “mode=register” URI, so I set about trying to change these.

They need to be changed in:



(remembering of course to rename the file profile.php too)

I changed mine to:

profile.php -> pmatters.php

mode=register -> mode=signupuser

Now, FINALLY, I have stopped getting robotic registrations!!