Protected: Pro PHP Security
on Thursday 6th March, 2008 Gabe speculated thusly…Posted in Books, Information, PHP, Programming
Enter your password to view comments
Posted in Books, Information, PHP, Programming
Enter your password to view comments
Posted in Books, CodeIgniter, Frameworks, Information, PHP, Programming
Enter your password to view comments
The following code is well commented, please read the comments for a thorough understanding.
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// The following js code will take the standard login form and hide it's
// labels. It will then change the password input type to text
// (so that normal letters are
// displayed in it), set the value of the email input to 'email. Set the
// value of the password input to 'password. These values server as the
// new labels.
(more…)
Posted in JavaScript, Programming, jQuery
I’m a big fan of the PHP framework, CodeIgniter. However, until recently it has lacked an elegant way of nesting an image in an anchor tag. I had to resort to manually typing out HTML like this:
<a href="<?=site_url?>/controller/action"><img src="<?=base_url()?>/images/button.gif"></a>
CodeIgniter 1.6 has been released, quickly followed by 1.6.1. This includes an image helper. One is still unable to elegantly link images using CI’s helpers. If you want to be able to do something like this:
<?= anchor( 'controller/action', img( 'images/button.gif' )?>
You could just comment out line 117 in /system/helpers/url_helper.php but that means you are altering CI core, which is not a good idea. For a start it will be overwritten when you upgrade and it is an inelegant hack.
A better bet is to create your own helper file and use it to override CodeIgniter’s one. This is dead-simple, just create a file called MY_url_helper.php in the following location /system/application/helpers/. Note that the MY_ prefix is set in the config.php file under $config['subclass_prefix'] = ‘MY_’; so if you have changed that setting you will need to adjust your file-name accordingly.
Then just copy and paste the following in to it: (more…)
Posted in CodeIgniter, Development, Frameworks, PHP, Programming
Recently, I had to setup a production environment for Rails applications at work. I encountered many difficulties, including problems with permissions on client/server computers, and not least because the documentation I had was out of date (Agile web dev and The Rails Way). Online tutorials were helpful but incomplete. I have compiled all that I discovered here. (more…)
Posted in Development, HowTo, Linux, Operating System, Programming, Ruby, Server
For the last couple of months we have been using a subversion server I setup for our version controlling. More recently I have experimented with newer (better?) version control systems. Subervion (svn) uses a central repository form which everyone must checkout working copies, and commit their changes there. However, there exists DRCS, or distributed revision control systems. These allow users to branch from other users, and commit to their own branches; or the central-model can be used.
Posted in Programming
Andrew commissioned me to give his books an on-line presence. He wanted only to list his books and nothing else such as shopping or contact details.This post summarises, and then specifies the project. Designs are presented, and a project plan is demonstrated. Finally, the project is completed and I can make the source code available on request. (more…)
Posted in Development, MySQL, PHP, Programming