The way I like to develop is to create specific virtual machines for my web development.
The chore is to start the machine, mount the file system and then open up your IDE. All a nuisance that takes time. So, I’ve taken to writing a simple Bash script that will do the grunt work for you. All you have to do is put in your settings, save it and run it!
This will mount the VM’s web folder onto your file system and let you know it’s connected. All you need to do is then start your IDE of choice! Continue reading Start and connect to your VirtualBox VM with a simple script
A little problem came up with some user submitted content on a platform I’m working with.
A form allows users to submit content with tinyMCE. If the content is pasted from MS Word, the source is then littered with HTML conditional comments that can have a detrimental effect on the the page that returns it.
After discovering what was going on, I thought that the best time to capture the offending content is when the text is submitted. Using a regular expression, I can capture the HTML conditionals as well as remove any unnecessary comments:
return preg_replace('/<!--(.|\s)*?-->/', '', $html);
That’s it. Just pass in the content from tinyMCE and it should prevent any content being returned that is in HTML comments.
I’ve been working on my first ‘proper’ CodeIgniter project this week. It’s been quite gruelling, as there are some moments where I have definitely sped up my production. But it’s constantly getting hampered by the learning curve. It may be slight, but is frustrating when I hit a wall.
One issue that just cam up is that I want to send multi-dimensional post data to the set_value function in the Form Helper. As you’re passing a string, the array is completely disregarded, and you’re left with nothing.
I’ve created an extension to the helper to temporarily get around the problem until I can look at it and fix it properly:
if ( ! function_exists('set_value_arr'))
function set_value_arr($field = '', $id = '0', $default = '')
if (FALSE === ($OBJ =& _get_validation_object()))
if ( ! isset($_POST[$field][$id]))
return form_prep($OBJ->set_value($field, $default));
This sets a second parameter as the array index. This way, you should be able to access form elements sent into the POST array as arrays themselves.
Well, Mo’s been beavering away and has almost finished the new forum over at the-company.com. Keep your eyes peeled!
In the meantime there are considerations of webcrawlers and such to extract the content as ProBoards have said, quite simply, you can’t have the database with your content.