Related Content
Drupal 11: Object Oriented Hooks And Hook Service Classes
Hooks are used in Drupal to allow modules and themes to listen to or trigger different sorts of events in a Drupal system. During these events Drupal will pause and ask if any modules want to have any say in the event that is currently being triggered.
LocalGov Drupal Camp 2025
LocalGov Drupal Camp 2025 was held in The Abbey Community Centre (near Westminster Abbey in London) on July 3rd 2025. I travelled down (despite the English rail network's attempts to the contrary) for the day as an attendee.
Converting Images To The Colour Pallet From The Matrix In PHP
Have you ever noticed the slightly green colouration in the movie The Matrix? The movies are full of different colour pallets, but when inside The Matrix everything gets a slight green colouration.
A Look At Flood Fill Algorithms In PHP
If you have ever used a paint program then you might have used a flood fill algorithm. This is a mechanism by which an area of an image can be filled with a different colour and is normally depicted by a pain can pouring paint.
A Look At Benford's Law
Benford's Law is an interesting heuristic in data analysis. It states that in any large collection of numbers that are created naturally, you should expect to see numbers starting with the number 1 about 30% of the time. The frequency distribution of numbers states that 2 should appear about 17% of the time, down to 9 being seen just 5% of the time.
Protecting A Page From Being Directly Accessed With PHP
I was thinking recently about the number of ways in which I could restrict access to a page using PHP.
The obvious option is to create a user authentication system, but in some situations that is overkill for what is required. If you just want to prevent users from going directly to a certain page then there are a few options open to you.
Comments
You could possibly do it via a hook_form_alter on the form and include the drupal_add_js() call in a form #after_build callback.
See http://api.drupal.org/api/drupal/developer--topics--forms_api_reference…
Submitted by budda on Thu, 11/03/2011 - 23:40
PermalinkAdd new comment