<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Alexander Rowley &#187; mail</title>
	<atom:link href="http://www.johnalexanderrowley.com/tag/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnalexanderrowley.com</link>
	<description>computer specialist and online marketing professional</description>
	<lastBuildDate>Thu, 02 Feb 2012 18:34:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Server Migration &#8211; Issues to look out for</title>
		<link>http://www.johnalexanderrowley.com/server-migration-issues-to-look-out-for/</link>
		<comments>http://www.johnalexanderrowley.com/server-migration-issues-to-look-out-for/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 19:54:07 +0000</pubDate>
		<dc:creator>John Alexander Rowley</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[agent]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[exporting]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[importing]]></category>
		<category><![CDATA[issues]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[mta]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[transfer]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.johnalexanderrowley.com/?p=2374</guid>
		<description><![CDATA[So this week saw the migration of my employer&#8217;s website from one server to another. Luckily it all went (relatively) smoothly, despite over-running by a few days due to an unresolved (critical) issue before the Christmas break. Never the less, it went well with only a couple of issues. Here&#8217;s a breakdown of what we [...]]]></description>
			<content:encoded><![CDATA[<p>So this week saw the migration of my employer&#8217;s website from one server to another. Luckily it all went (relatively) smoothly, despite over-running by a few days due to an unresolved (critical) issue before the Christmas break. Never the less, it went well with only a couple of issues. Here&#8217;s a breakdown of what we encountered during the migration.</p>
<p>So, we used a migration specialist, <a href="http://www.semsolutions.co.uk/">SEM Solutions</a>, to aid with the process. They handled the database copying, which is always the tricky bit, and uploaded the entire file-structure (public_html in the case of the old server). This is really the first two points to be aware of.</p>
<p><strong>1 &#8211; Exporting / Importing databases can be hard!</strong> Make sure you know what you&#8217;re doing before attempting this (I tried it once and ended up having to recover my articles via wayback-machine and Google Cache, although that was a few years ago!).</p>
<p><strong>2 &#8211; Check your full URL paths. </strong>When linking directly to files, if you include the web root folder from the FTP be sure it&#8217;s the same on the new server. For example, on the new server is uses &#8216;http_docs&#8217; rather than &#8216;public_html&#8217; as the web root folder. </p>
<p>There&#8217;s another similar issue here; the server back-end UI. Be sure you inquire about which one comes with a server before making the switch.</p>
<p><strong>3 &#8211; CPanel vs PLESK.</strong> Parallel PLESK is new to me, as I&#8217;ve always used old faithful CPanel. PLESK, despite looking less functional and more dated (in my opinion, at least) has similar sections in terms of functionality. It&#8217;s quite well documented too, as is CPanel, meaning a switch between the two shouldn&#8217;t be too much of an issue (it wasn&#8217;t for me, at least).</p>
<p>There was one final issue, which caused the delay in migration. It&#8217;s a site specific problem, but it can be applied to almost any website with a contact form.</p>
<p><strong>4 &#8211; Mail Transfer Agent.</strong> The issue we encountered was the following: We have a contact form. It adds data to a database. It also emails the data to a range of email addresses and produces an XML (more to follow). The contact form was functioning, but it seemed sporadic in the emails (they always came through blank despite the data being added to the database. The solution, you ask? Well, after a few days of head-scratching we discovered it was in fact &#8216;\r\n&#8217; in the functions file of the form being rendered differently by the new server&#8217;s MTA (QMail as apposed to EXIM). This produced an additional line break which ended the header section of the form.</p>
<p>As I said, site specific. But if your experiencing similar issues it&#8217;s worth checking the PHP functionality for unnecessary line breaks!</p>
<p><strong>5 &#8211; Permissions.</strong> A final note &#8211; Check your permissions! The XML mentioned above was failing to be created (even temporarily) due to permissions! This is something a &#8216;live chat assistant&#8217; can usually do over the chat-box.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnalexanderrowley.com/server-migration-issues-to-look-out-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Email Form with validation code: Part 1</title>
		<link>http://www.johnalexanderrowley.com/simple-email-form-with-validation-code-part-1/</link>
		<comments>http://www.johnalexanderrowley.com/simple-email-form-with-validation-code-part-1/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 10:11:33 +0000</pubDate>
		<dc:creator>John Alexander Rowley</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[email form]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.johnalexanderrowley.com/?p=440</guid>
		<description><![CDATA[This is my first real tutorial (more commented code than a real tutorial), and is as much for myself as everyone else (I&#8217;m using the blog as a sort of resource store for myself, with the added bonus that everyone else can see it too!). Anyway, the idea here is some explained code to produce [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first real tutorial (more commented code than a real tutorial), and is as much for myself as everyone else (I&#8217;m using the blog as a sort of resource store for myself, with the added bonus that everyone else can see it too!).</p>
<p>Anyway, the idea here is some explained code to produce a simple online form which will email a person/s the data from the form. It also includes validation to ensure that the form can not be sent unless the data is precise and relevant.</p>
<p>On to part one &#8211; The Form and the mail functionality.</p>
<p>The first thing we need to do is create the form itself for the user to put there data in.</p>
<p><code>&lt;form method="post" onsubmit="return validate(this);" action="formPage.php"&gt;  &lt;input id="name" size="50"/&gt; &lt;input id="company" size="50" /&gt; &lt;input id="contact" size="50" /&gt; &lt;input id="telephone" size="50" /&gt; &lt;textarea cols="38" rows="5" id="description"&gt;&lt;/textarea&gt; &lt;input id="quantity" size="4" /&gt;  &lt;input value="Submit"/&gt; &lt;input value="Reset" /&gt;  &lt;/form&gt;</code></p>
<p>The opening form tag contains method=&#8221;post&#8221; used to actually post the data, onsubmit which is used to call the validation function and action which links back to itself. The .php file in the action will have to be renamed the same as the page the form is being displayed on. There are two buttons at the bottom (&#8216;input values&#8217;) one of which will submit the form (method, onsubmit and action) and the other will clear all data from the form. Simple!</p>
<p>Next, the code to email the data to the admin:</p>
<p><code><em>&lt;?php</em></p>
<p>if(isset($_POST['contact'])){  $admin = "recipient@sendToEmailAddress.com"; $name = $_POST['name']; $company = $_POST['company']; $contact = $_POST['contact']; $telephone = $_POST['telephone']; $description = $_POST['description']; $quantity = $_POST['quantity'];    mail($admin, 'Subject Title', "This email was generated using the Product Resource Form at www.johnalexanderrowley.com.\n Name: $name Company: $company Email: $contact Telephone: $telephone Description: $description Quantity: $quantity", 'from: fromAddress@fromaddressEmail.com'); ?&gt;    &lt;script&gt; alert("Thank you for using the formPage.\n Your request has been sent to the Relevant person."); &lt;/script&gt;   &lt;?php } ?&gt; The IF statement checks if the input field (in this case 'contact') has been filled in. If it has then the following mail code is ran. This stops the form submitting when the page is loaded.<br />
</code><br />
The various variables are set, including the &#8216;$admin&#8217; variable which contains the email address that the data is to be sent to. The other variables pull in the previously posted form values. The form &#8216;input id&#8217; is the text contained within the square brackets in each case.</p>
<p>Now the variables have been set the mail can actually take place; The &#8216;mail&#8217; php function is called which requires a recipient, subject title, content and header information separated by commas. These are defined in the normal brackets using the various variables. Note that the content is comprised of various variables and no commas are used.</p>
<p>Finally, a javascript script is used to display a thank you message, and the IF statement is closed!</p>
<p>Hay presto, the form is created and will email the admin.</p>
<p>To add validation to the form, please view Part 2!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnalexanderrowley.com/simple-email-form-with-validation-code-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

