| Home | Pauline's Pages | Howto Articles | Uniquely NZ | Small Firms | Search |
| Freezone for Small Firms |
| Contents |
Freezone offer a number of packages. The basic "starter" hosting package at £1.49 per month offers a 5 mailboxes and unlimited aliases which is perfectly adequate to start with. You get more independent POP or IMAP boxes with the more expensive packages (200 with the "Essential" package at £3.99 per month) which I have.
They also have an email only package at 0.99p/month with a FREE domain name which offers:
I use their dial-up connection in preference to others I have available when away from broadband in the UK as it is fast and reliable and works well via a mobile telephone. You do not however need to send emails using their own Network as they provide an authenticated SMTP mail server which I use on broadband at home and abroad although I have noticed a few networks such as Xtra in NZ now prevent use of even authenticated SMPT servers other than their own. There is also an excellent and very comprehensive webmail package for when you are away from base. I have written a new page about Howto Send Email from Anywhere which covers the use and advantages of Authenticated SMTP and use of Freezone when traveling to complement my general page covering Global Communications and Computing which includes some coverage of the Advantages of IMAP Mailboxes which are included as standard with Freezone.
You have a control panel to administer your email account(s) so you can set up the POP and IMAP mail boxes, aliases, virus checking, spam checking and mail forwarding etc as well as controlling your web space. The control panel has recently changed from one provided by Ensim to one from Plesk that is even easier to use.
A very important attribute is that they offer free virus checking of all incoming and outgoing email and trapping of spam. This is not a complete substitute for a good virus checker routinely updated but it is an important first line of de fence as it is likely to be kept up to date on an hourly basis whilst even systems such as McAfee which automatically interrogate for updates are likely to fail to update before the first email collection of the day is complete.
There is a useful free analysis of site statistics (Webalizer) which is part of the hosting packages. It provides a daily and monthly analysis of Hits, Files, Pages, Visits and Kbytes downloaded in both graphic and tabular form. You also have information on the popular pages and geographic distribution of visitors etc. Web site statistics are an important tool in assessing the performance of ones web site and improvements to it and many service providers charge for providing such an analysis whilst here it is free even on the £1.49/month "Starter" package.
<html><head><title>Freezone Form Example</title></head><p>
<center><h2> This is an example of a form.</h2></center>
<form METHOD=POST ACTION="cgi-pub.freezone.co.uk/cgi-bin/formmail.pl"><p>
<input TYPE=hidden name="recipient" value="admin@yourname.co.uk"><p>
<input type=hidden name="required" value="name, email"><p>
<input TYPE=hidden name="subject" value="Example web site form" ><p>
<input TYPE=hidden name="redirect" value="http://www.yourname.co.uk/form_response.htm"
><p>
Name:<br>
<input NAME="name" size=35><p>
Email address:<br>
<input NAME="email" size=35><p>
Phone Number:<br>
<input NAME="phone" size=35><p>
Comments:<br>
<textarea NAME="comments" ROWS="5" COLS="30"></textarea><p><br>
<input TYPE="submit" VALUE="Submit">
<input TYPE="reset" VALUE="Erase">
</form>
</body>
</html>
I have only made use of a small number of the hidden variables available in the example above. For more information on FormMail you should visit the author Matt's at Script Archive I you get a response saying that that yourdomain is not the referrers list this means your domain has not been added to those permitted to use the script and an email to support@freezone.co.uk will get it quickly added - it is dome on a server basis they do not always add new servers until needed for security.
Firstly PHP is very simple to get to grips with. Typing of variables is very weak and you can drop in and out of PHP as often as you like on a web page. There are lots of useful functions with meaningful names and it is well documented at uk.php.net with starter tutorials as well as comprehensive reference material. Perhaps the only unusual thing to note when looking at or modifying my script is that Strings can be enclosed in " " or ' ' quotes but variables which always start with a $ are handled differently in the case of " " the enclosed variables are recognised and substituted whilst with ' ' this does not occur. Try this simple program - put in a file called strexample.php and upload it to your site. Obviously it will not work locally as PHP is server side scripting and runs on your web server to deliver an HTML page to the browser.
php
$example = "Hello World";
echo "In double quotes we get: $example <br>"; // gives Hello World
echo 'In single quotes we get: $example'; // gives $example
?>
If you forget all error checking and security you can do a form to email in a single line of script! The following will send you an email if you put in your details and upload it as a .php file it is however only secure as has all the addresses 'hard wired' so read what follows rather than just try to modify it
<?php mail("someone@yourdomain","Test Message","Hello World", "From: website@yourdomain\r\nReply-To: someone@yourdomain\r\nX-Mailer: PHP/" . phpversion() ); ?>
The following is the 'guts' of the new code for my feedback form for PHP which can be dropped into the body of an HTML page. It is well commented and the PHP functions are mostly self explanatory from their names. You can look them up at uk.php.net - only a dozen or so functions and environment variables are used here which demonstrated the power of PHP.
This script carries out some error checking to make avoid
being used as a spam relay however the main checking of the
parameters should be done by JavaScript on the page from which the
form is submitted as there is no provision to correct errors here.
It first strips out invalid characters from the form input to
prevent hacking. It then checks that the script has not
been called directly and checks it is called from a permitted
domain. For security all of these are 'hard wired' into the script.
<?php /* Script Handler for forms on Freezone. */ echo "<center><h3>Form from $email on $feedback_page</h3></center>"; /* Set up for domain checks */ $domain1 = 'yourdomain'; $domain2 = 'yourseconddomain'; // if required $referrer=strtolower($_SERVER["HTTP_REFERER"]); $pos1 = strpos($referrer, $domain1); $pos2 = strpos($referrer, $domain2); /* Check that the script has not been called directly by checking the parameter has been set */ if (!isset($_POST['email'])) { echo "<p>Error - possibly called directly rather than from a web page</p>\n"; } /* Now check it is called from a permitted domain */ elseif (($pos1 === false) && ($pos2 === false) ) { echo "Not called from a valid domain</p>\n"; } /* Then check any other required parameters are set */ elseif (empty($email) || empty($commentbox)) { echo "<p>Required parameters were not completed - please use back button and try again</p>\n"; } /* and finally check email address is reasonable ie do we have alphanumeric characters + an @ sign + a . + only 2 to 4 alpha characters. Thanks to tim at rocketry dot org for this code */ elseif(!eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $email)) { echo "<p>$email - This is not a reasonable email address - please use back button and try again</p>\n"; } else { /* Success - write what you are sending to the page then send out the email */ /* This code first converts the string to HTML characters then changes various forms of line end to the HTML break tag to avoid a spaghetti output from the form input. It processes \r\n's first so they aren't converted twice. It then compacts multiple breaks. Any Additional backslashes are removed by stripslashes() */ $str = str_replace( array("\r\n","\n","\r"),'<br>',htmlspecialchars($commentbox)); for( $i = 5 ; $i >=0 ; $i -= 1 ) { $str = str_replace( array(" <br>","<br> <br>","<br> <br>","<br><br>"),'<br>' , $str); } $str = stripslashes($str); /* Now write to the page so the form filler has a record */ echo "An email with your input has been sent with: <p>"; echo "<b>SUBJECT:</b> Form from $email on $feedback_page<br>"; echo "<b>REPLY-TO:</b> $email<br>"; echo "<b>CONTENT:</b> $str<br>"; /* Finally send the email using mail() */ mail("you@yourdomain","Form from " . $email . "on" . $feedback_page , $commentbox , "From: website@yourdomain\r\nReply-To: " . $email . "\r\nX-Mailer: PHP/" . phpversion() ); } /* If you use this please acknowledge that this is based on a PHP Script provided by Peter Curtis at www.pcurtis.com */ ?>The following code can be added to the page to reduce the chances of the script being cached. It works by generating raw HTTP headers and must be before any HTML at the top of the file even before the <!DOCTYPE declaration. For some reason do not have any /* */ type comments in it or you may lose output!
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP 1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Pragma: no-cache"); // HTTP 1.0
?>
My own forms use a generic version of this script which you can use to send me a message if you have any comments or even if you have found it useful.
As far as I can tell one can not create new files or change permissions from a PHP script on the Freezone Plesk servers - a reasonable and sensible restriction on the grounds of security but one which does limit one to 'log' type files where one is appending each form in turn. The other way is to read the file into a string so you can add the new entry at the top and perhaps truncate at a given length.
The functions to look up on PHP.net to start you off are fopen(), fread(), fwrite() feof(), fclose() and the test functions file_exists() and is_writable(). NOTE file_get_contents() is only available on PHP 4.3 or higher and file_put_contents() is only on PHP 5.0 and higher - Freezone uses PHP 4.3.11
The Administrative side has made the occasional error in the early days but they have always been very helpful and responsive. They have always immediately acknowledged when they have made an error and apologised - very rare in this day and age. For a long time they left me on an early tariff which offers excellent value whilst allowing me use of the major new enhancements in facilities as they occur. They did not even complain when I dropped back a tariff when their new limits exceeded anything I aspire to for web space and traffic.
|
Copyright ©
Peter and Pauline Curtis Most recent significant revision: 30th August, 2007 |
|