Friday, February 29, 2008

Un-solicited e-mail and the small business

This whole issue about receiving un-solicited e-mail when it comes to businesses is a bit hypocritical you get these big corporate companies and bored IT professionals that drone on about how bad it is to receive un-solicited e-mails and spamming is bad etc etc but at the same it's ok for them to send out printed material to physical addresses from a list they bought from BT. Now to me receiving junk mail through the post is worse than an e-mail.

Phone them first, how is this better? Getting cold calls is ten times worse as often you can't even understand their english and nine times out of ten these calls are not even remotely targeted. But hey this is ok according to the corporates and anti-spam evangelists.

Rather do Google keywords and SEO etc I see on forums allot. It's not that easy for small businesses trying to get off the ground to do this, a lot of them can't afford to hire expensive SEO and online consultancy companies to do it right. To appear in the top search results organically takes knowledge, time and lots of money which more often than not a start-up can't afford.

If an e-mail from one business to another that is targeted (ie don't try and sell bricks to a florist) and setup correctly (clearly laid out, full address and contact details plus clear instructions on how to stop receiving further correspondence) it is not in my opinion evil. I for one have found great suppliers that have saved us lots of money as well as some that has turned in to clients from so called spam. I often get un-solicited e-mails forwarded to me with useful information in them.

Don't get me wrong I get hundreds of e-mail with inappropriate content of a sexual nature and they are a nuisance and there is no way to stop it as they contain no un-subcribe information, but to put a small business trying to get much needed work, under the same umbrella is wrong. Often it is the best option for their limited budget available to them.

Tuesday, February 19, 2008

open_basedir restriction in effect error in PHP

This must be one of the most annoying errors to get when working with php. This error occurs when PHP can't find the specified file in the include statement. This often occurs when a developer has built an application on their machine and uploaded the application to a shared hosting account or if they move the application to a sub folder.

An easy work around is to determine the path to the called file dynamically.

$folcnt = substr_count($_SERVER["PHP_SELF"], "/");
$folappstep = "";
if($folcnt > 1) {
for($i=2;$i<=$folcnt;$i++) {
$folappstep .= "../";
}
} else {
$folappstep = "";
}

$extfile = $folappstep."ws8_extensions.php";
$funfile = $folappstep."ws8_functions.php";

include $extfile;
include $funfile;

Thursday, February 14, 2008

Check to see if a cfwindow exists

Check to see if a cfwindow exists
When a window gets created by <cfwindow> coldfusion gives it a unique name and not the name you assigned it.
I have found a work around in the way of checking for the title of the window as when you create a cfwindow the window title div get the id of yourwinname_title.

Example javascript
<cfajaximport tags="cfwindow"/>
<script language="javascript">
function createphloadwin() {
if(document.getElementById('mywindow_title')) {
var x = "true";
// Show the window
ColdFusion.Window.show("mywindow");
} else {
var x = "false";
// Create a new window
ColdFusion.Window.create("mywindow", "Upload Photos", "", {height:250,width:400,closable:true,draggable:true,resizable:false,center:true,initshow:true,modal:true })
// Put your content in the window or you can assign the url in the ColdFusion.Window.create()
document.getElementById('mywindow_body').innerHTML = 'My Window content';
}
alert(x);
}
</script>

<a href="javascript:createphloadwin();">Check for window</a>